Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica
Skip to main content

Module crypto

Module crypto 

Source
Expand description

Cryptographic functions for user system

Provides key derivation and encryption using:

  • Argon2id for key derivation from password + salt
  • 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.
generate_salt
Generate a random salt string for Argon2id key derivation.