{"id":13577837,"url":"https://github.com/LoupVaillant/Monocypher","last_synced_at":"2025-04-05T15:31:32.380Z","repository":{"id":40523808,"uuid":"97625830","full_name":"LoupVaillant/Monocypher","owner":"LoupVaillant","description":"An easy to use, easy to deploy crypto library","archived":false,"fork":false,"pushed_at":"2024-11-01T09:18:12.000Z","size":4179,"stargazers_count":597,"open_issues_count":9,"forks_count":79,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-11-01T10:20:46.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://monocypher.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LoupVaillant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-18T17:28:53.000Z","updated_at":"2024-11-01T09:18:16.000Z","dependencies_parsed_at":"2023-02-15T01:46:23.920Z","dependency_job_id":"7fa313f6-4bb3-45f8-bd0e-0464de4f371d","html_url":"https://github.com/LoupVaillant/Monocypher","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoupVaillant%2FMonocypher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoupVaillant%2FMonocypher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoupVaillant%2FMonocypher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LoupVaillant%2FMonocypher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LoupVaillant","download_url":"https://codeload.github.com/LoupVaillant/Monocypher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247358762,"owners_count":20926283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:01:24.746Z","updated_at":"2025-04-05T15:31:31.273Z","avatar_url":"https://github.com/LoupVaillant.png","language":"C","funding_links":[],"categories":["C","Cryptography","others"],"sub_categories":["General"],"readme":"[![TrustInSoft CI](https://ci.trust-in-soft.com/projects/LoupVaillant/Monocypher.svg?branch=master)](https://ci.trust-in-soft.com/projects/LoupVaillant/Monocypher)\n\n[![Github Actions CI](https://github.com/LoupVaillant/Monocypher/actions/workflows/ci.yml/badge.svg)](https://github.com/LoupVaillant/Monocypher/actions/workflows/ci.yml)\n\n\nMonocypher (Developer Edition)\n------------------------------\n\n_(This is the bleeding edge, not yet released version.  If you just want\nto use Monocypher, grab the [latest version][latest], or download the\n[source][] and [header][] files directly. If you want to contribute, see\nthe notes at the end.)_\n\n[source]: https://monocypher.org/download/monocypher.c\n[header]: https://monocypher.org/download/monocypher.h\n[latest]: https://monocypher.org/download/monocypher-latest.tar.gz\n\n---\n\nMonocypher is an easy to use, easy to deploy, auditable crypto library\nwritten in portable C.  It approaches the size of [TweetNaCl][] and the\nspeed of [libsodium][].\n\n[Official site.](https://monocypher.org/)  \n[Official releases.](https://monocypher.org/download/)\n\n[libsodium]: https://libsodium.org\n[TweetNaCl]: https://tweetnacl.cr.yp.to/\n\n\nFeatures\n--------\n\n- [Authenticated Encryption][AEAD] with XChaCha20 and Poly1305\n  (RFC 8439).\n- [Hashing and key derivation][HASH] with BLAKE2b (and [SHA-512][]).\n- [Password Hashing][PWH] with Argon2.\n- [Public Key Cryptography][PKC] with X25519 key exchanges.\n- [Public Key Signatures][EDDSA] with EdDSA and [Ed25519][].\n- [Steganography and PAKE][STEG] with [Elligator 2][ELLI].\n\n[AEAD]:    https://monocypher.org/manual/aead\n[HASH]:    https://monocypher.org/manual/blake2b\n[SHA-512]: https://monocypher.org/manual/sha512\n[PWH]:     https://monocypher.org/manual/argon2\n[PKC]:     https://monocypher.org/manual/x25519\n[EDDSA]:   https://monocypher.org/manual/eddsa\n[Ed25519]: https://monocypher.org/manual/ed25519\n[STEG]:    https://monocypher.org/manual/elligator\n[ELLI]:    https://elligator.org\n\n\nManual\n------\n\nThe manual can be found at https://monocypher.org/manual/, and in the\n`doc/` folder.\n\n\nInstallation\n------------\n\n### Option 1: grab the sources\n\nThe easiest way to use Monocypher is to include `src/monocypher.h` and\n`src/monocypher.c` directly into your project.  They compile as C (since\nC99) and C++ (since C++98).\n\nIf you need the optional SHA-512 or Ed25519, grab\n`src/optional/monocypher-ed25519.h` and\n`src/optional/monocypher-ed25519.c` as well.\n\n### Option 2: grab the library\n\nRun `make`, then grab the `src/monocypher.h` header and either the\n`lib/libmonocypher.a` or `lib/libmonocypher.so` library.  The default\ncompiler is `gcc -std=c99`, and the default flags are `-pedantic -Wall\n-Wextra -O3 -march=native`.  If they don't work on your platform, you\ncan change them like this:\n\n    $ make CC=\"clang -std=c11\" CFLAGS=\"-O2\"\n\n### Option 3: install it on your system\n\nRun `make`, then `make install` as root. This will install Monocypher in\n`/usr/local` by default. This can be changed with `PREFIX` and\n`DESTDIR`:\n\n    $ make install PREFIX=\"/opt\"\n\nOnce installed, you may use `pkg-config` to compile and link your\nprogram.  For instance:\n\n    $ gcc program.c $(pkg-config monocypher --cflags) -c\n    $ gcc program.o $(pkg-config monocypher --libs)   -o program\n\nIf for any reason you wish to avoid installing the man pages or the\n`pkg-config` file, you can use the following installation sub targets\ninstead: `install-lib`, `install-doc`, and `install-pc`.\n\n\nTest suite\n----------\n\n    $ make test\n\nIt should display a nice printout of all the tests, ending with \"All\ntests OK!\". If you see \"failure\" or \"Error\" anywhere, something has gone\nwrong.\n\n*Do not* use Monocypher without running those tests at least once.\n\nThe same test suite can be run under Clang sanitisers and Valgrind, and\nbe checked for code coverage:\n\n    $ tests/test.sh\n    $ tests/coverage.sh\n\n\n### Serious auditing\n\nThe code may be analysed more formally with [Frama-c][] and the\n[TIS interpreter][TIS].  To analyse the code with Frama-c, run:\n\n    $ tests/formal-analysis.sh\n    $ tests/frama-c.sh\n\nThis will have Frama-c parse, and analyse the code, then launch a GUI.\nYou must have Frama-c installed.  See `frama-c.sh` for the recommended\nsettings.  To run the code under the TIS interpreter, run\n\n    $ tests/formal-analysis.sh\n    $ tis-interpreter.sh --cc -Dvolatile= tests/formal-analysis/*.c\n\nNotes:\n\n- `tis-interpreter.sh` is part of TIS.  If it is not in your path,\n  adjust the command accordingly.\n\n- The TIS interpreter sometimes fails to evaluate correct programs when\n  they use the `volatile` keyword (which is only used as an attempt to\n  prevent dead store elimination for memory wipes).  The `-cc\n  -Dvolatile=` option works around that bug by ignoring `volatile`\n  altogether.\n\n[Frama-c]:https://frama-c.com/\n[TIS]: https://trust-in-soft.com/tis-interpreter/\n\n\nCustomisation\n-------------\n\nMonocypher has optional compatibility with Ed25519. To have that, add\n`monocypher-ed25519.h` and `monocypher-ed25519.c` provided in\n`src/optional` to your project.  If you compile or install Monocypher\nwith the makefile, they will be automatically included.\n\nMonocypher also has the `BLAKE2_NO_UNROLLING` preprocessor flag, which\nis activated by compiling monocypher.c with the `-DBLAKE2_NO_UNROLLING`\noption.\n\nThe `-DBLAKE2_NO_UNROLLING` option is a performance tweak.  By default,\nMonocypher unrolls the BLAKE2b inner loop, because doing so is over 25%\nfaster on modern processors.  Some embedded processors however, run the\nunrolled loop _slower_ (possibly because of the cost of fetching 5KB of\nadditional code).  If you're using an embedded platform, try this\noption.  The binary will be about 5KB smaller, and in some cases faster.\n\nThe `MONOCYPHER_CPP_NAMESPACE` preprocessor definition allows C++ users\nwho compile Monocypher as C++ to wrap it in a namespace. When it is not\ndefined (the default), we assume Monocypher is compiled as C, and an\n`extern \"C\"` declaration is added when we detect that the header is\nincluded in C++ code.\n\nThe `change-prefix.sh` script can rename all functions by replacing\n`crypto_` by a chosen prefix, so you can avoid name clashes. For\ninstance, the following command changes all instances of `crypto_` by\n`foobar_` (note the absence of the underscore):\n\n    ./change-prefix.sh foobar\n\n\nContributor notes\n-----------------\n\nIf you are reading this, you cloned the GitHub repository.  You miss a\ncouple files that ship with the tarball releases:\n\n- The `tests/vectors.h` header.  Generating it requires libsodium. Go\n  to `tests/gen/`, then run `make`.\n- The html version of the manual, generated by the `doc/doc_gen.sh`\n  script.  You will need mandoc and Python 3.\n\nTo generate a tarball, simply type `make dist`. It will make a tarball\nwith a name that matches the current version (using `git describe`), in\nthe current directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLoupVaillant%2FMonocypher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLoupVaillant%2FMonocypher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLoupVaillant%2FMonocypher/lists"}