Tiny, zero-dependency cryptographic primitives library for D language. Its main use case is building custom secure transport layers, e.g. for online games, VoIP and IoT.
Most of it is a direct port of Monocypher C code to D, retaining Monocypher API.
Most existing libraries are bloated with legacy crypto primitives that should not be used for building new stuff. Trying to support every existing standard makes them over-engineered and confuses users. Minicrypto provides only a minimal set of modern algorithms. It is not a binding nor a wrapper around system cryptography, and has no dependencies, which makes usage easy and straightforward. Also Minicrypto is the only known @nogc and betterC-compliant crypto library for D. Manual memory management is preferable in real-time applications and a strict requirement for system development.
- Fast
- No garbage collector usage (
@nogc) - Portable across Windows and Posix systems
minicrypto.argon2- Argon2 key derivation functionminicrypto.blake2b- BLAKE2b cryptographic hash functionminicrypto.chacha20- ChaCha20 stream cipherminicrypto.poly1305- Poly1305 one-time message authentication codeminicrypto.aead- ChaCha20-Poly1305 authenticated encryption with associated data (AEAD) algorithmminicrypto.x25519- elliptic-curve Diffie-Hellman based on Curve25519minicrypto.eddsa- EdDSA digital signature algorithm based on Curve25519minicrypto.csprng- cryptographically secure pseudorandom number generatorminicrypto.base64- Base64 encoder and decoderminicrypto.hex- data-to-hex encoder and decoder.
Minicrypto can be optionally used in BetterC mode. Add the following to your dub.json:
"subConfigurations": {
"minicrypto": "betterC"
}