Monocypher is an easy to use crypto library. It is:
- Small. Sloccount counts less than 1500 lines of code, small enough to allow audits. The binaries are under 65KB.
- Easy to deploy. Just add
monocypher.hto your project. They compile as C99, C11, or C++, and have no dependency.
- Easy to use. The API is small, consistent, and cannot fail on correct input.
- Fast. The primitives are fast to begin with, and performance wasn't needlessly sacrificed. Monocypher holds up pretty well against Libsodium, despite being closer in size to TweetNaCl. (More detailed benchmark)
2018/03/07 Monocypher 2.0.1 is out. No visible change, just a little patch to enhance auditability.
2018/03/06 A semi-formal proof that Monocypher's Poly1305 works was conducted. This applies to an upcoming patch of Monocypher, which will enhance auditability.
Download the latest Monocypher, and run the test suite:
$ tar -xzf monocypher-2.0.1.tar.gz $ cd monocypher-2.0.1 $ make test
Optionally, you can generate and install binaries on your system:
$ make $ sudo make install
Or you can just integrate Monocypher source files into your project:
$ cp src/monocypher.c path/to/your/source/folder $ cp src/monocypher.h path/to/your/include/folder
- Authenticated encryption implements RFC 7539 with XChacha20 and Poly1305. XChacha20 nonces are big enough to be random.
- Hashing uses Blake2b, which is as secure as SHA-3, and as fast as MD5.
- Password key derivation is done with Argon2i, which won the Password Hashing competition.
- Key exchange uses X25519.
- Signatures use EdDSA with Blake2b and curve25519. Strict Ed25519 conformity (with SHA-512 instead of Blake2b) is provided as an option.