Cryptographic/argon2 library
🔐 Argon2 Key Derivation Function Implementation
A production-ready implementation of the Argon2 key derivation function, the winner of the Password Hashing Competition. This implementation provides secure key derivation with configurable memory, time, and parallelism costs for defense against hardware attacks.
Features:
- RFC 9106 compliant Argon2 implementation
- Support for Argon2d, Argon2i, and Argon2id variants
- Configurable t (time cost), m (memory cost), p (parallelism)
- Optimized for performance with minimal memory allocation
- Comprehensive error handling and validation
- Thread-safe implementation suitable for concurrent environments
- Produces configurable length output (typically 32 bytes)
Time complexity: O(t * m * p) where t, m, p are the Argon2 parameters Space complexity: O(m) memory usage
Example:
final key = Argon2.deriveKey('password', 'salt', t: 3, m: 65536, p: 4, dkLen: 32);
print(key); // 64-character hex string
Classes
- Argon2
- Argon2 key derivation function implementation
Enums
- Argon2Variant
- Argon2 variants