Expand description
Symmetric encryption utilities.
Constants§
- ARGO
N2_ TAG - Tag byte for Argon2id-derived encryption blobs.
- NONCE_
LEN - Byte size of the nonce used in both AES-GCM and ChaCha20Poly1305.
- PASSPHRASE_
POLICY_ HINT - Human-readable statement of the passphrase policy
validate_passphraseenforces. Shown before an interactive prompt so the rule is known up front, not learned by violating it. Single source of truth: the prompt hint and the validator read the same policy from here. - PRODUCTION_
KDF_ M_ COST_ KIB - Production Argon2id memory cost in KiB (64 MiB). Exposed as a const so the strength of the at-rest KDF can be asserted regardless of build profile (test builds derive keys with deliberately weak params for speed).
- PRODUCTION_
KDF_ P_ COST - Production Argon2id parallelism.
- PRODUCTION_
KDF_ T_ COST - Production Argon2id time cost (iterations).
- SALT_
LEN - Byte size of the salt used in key derivation.
- SYMMETRIC_
KEY_ LEN - Length in bytes of a symmetric encryption key (256-bit).
- TAG_LEN
- Byte size of the algorithm tag prefix.
Functions§
- decrypt_
bytes - Decrypts data using a tagged encryption format and a user-provided passphrase.
- encrypt_
bytes - Encrypt data using Argon2id for key derivation, prepending tag 0x03.
- get_
kdf_ params - Returns Argon2id parameters for key derivation.
- validate_
passphrase - Validates that a passphrase meets minimum strength requirements.