Skip to main content

Module encryption

Module encryption 

Source
Expand description

Symmetric encryption utilities.

Constants§

ARGON2_TAG
Tag byte for Argon2id-derived encryption blobs.
NONCE_LEN
Byte size of the nonce used in both AES-GCM and ChaCha20Poly1305.
SALT_LEN
Byte size of the salt used in HKDF 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, prepending a tag to identify algorithm during decryption.
encrypt_bytes_argon2
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.