Skip to content

Latest commit

 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minicrypto

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.

GitHub Actions CI Status DUB Package SLSA 3 License: CC0-1.0

Why another crypto library?

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.

Features

  • Fast
  • No garbage collector usage (@nogc)
  • Portable across Windows and Posix systems

Modules

  • minicrypto.argon2 - Argon2 key derivation function
  • minicrypto.blake2b - BLAKE2b cryptographic hash function
  • minicrypto.chacha20 - ChaCha20 stream cipher
  • minicrypto.poly1305 - Poly1305 one-time message authentication code
  • minicrypto.aead - ChaCha20-Poly1305 authenticated encryption with associated data (AEAD) algorithm
  • minicrypto.x25519 - elliptic-curve Diffie-Hellman based on Curve25519
  • minicrypto.eddsa - EdDSA digital signature algorithm based on Curve25519
  • minicrypto.csprng - cryptographically secure pseudorandom number generator
  • minicrypto.base64 - Base64 encoder and decoder
  • minicrypto.hex - data-to-hex encoder and decoder.

BetterC

Minicrypto can be optionally used in BetterC mode. Add the following to your dub.json:

"subConfigurations": {
    "minicrypto": "betterC"
}

License

CC0 1.0 Universal

About

Modern cryptography for D

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages