Modern Cryptography & Hashing Toolkit (Rust)
A misuse-resistant, high-level cryptography library with safe defaults, constant-time verification, and clear APIs for hashing, password hashing, key derivation, symmetric encryption, HMAC, and digital signatures.
Features
- Safe hashing: SHA-256, SHA-384, SHA-512, SHA-3, BLAKE2
- HMAC: Constant-time verification
- Password hashing: Argon2id, scrypt, bcrypt, PBKDF2-SHA256
- Key derivation: PBKDF2 and scrypt
- Symmetric encryption: AES-256-GCM and ChaCha20-Poly1305
- Digital signatures: Ed25519
Installation
Add this to your Cargo.toml:
[]
= "1.0.0"
Or use cargo add:
Quick Start
use ;
let sha256 = string.unwrap;
let mac = hmac.unwrap;
assert!;
let ph = hash.unwrap;
assert!;
let salt = b"saltsaltsaltsalt";
let key = derive.unwrap;
let ciphertext = symmetric.unwrap;
let plaintext = decrypt_string.unwrap;
assert_eq!;
let = generate_keypair.unwrap;
let signature = ed25519.unwrap;
assert!;
Development
License
MIT License