Expand description
Cryptographic functions for user system
Provides password hashing and key encryption using:
- Argon2id for password hashing
- AES-256-GCM for key encryption
Constants§
- KEY_
LENGTH - Derived key length for AES-256 (32 bytes)
- NONCE_
LENGTH - Nonce length for AES-GCM (12 bytes standard)
- SALT_
LENGTH - Salt string length for Argon2 (base64 encoded, 22 chars)
Functions§
- decrypt_
private_ key - Decrypt a private key.
- derive_
encryption_ key - Derive an encryption key from a password and salt using Argon2id
- encrypt_
private_ key - Encrypt a private key with a password-derived encryption key.
- hash_
password - Hash a password using Argon2id
- verify_
password - Verify a password against its hash