Skip to main content

Module crypto

Module crypto 

Source
Expand description

Layer 2 — cryptography.

Password-based key derivation (Argon2id), key expansion into independent subkeys (HKDF-SHA3-512), authenticated encryption (XChaCha20-Poly1305) and payload compression. Every type that holds key material implements ZeroizeOnDrop.

The layer is a one-way chain, and each stage narrows what the next one can do wrong:

password + phash --Argon2id--> MasterKey
                 --HKDF-SHA3-512--> DerivedKeys { enc_key, nonce, stc_seed }
plaintext --zstd--> compressed --XChaCha20-Poly1305--> ciphertext

Modules§

aead
XChaCha20-Poly1305 authenticated encryption of the payload.
expand
HKDF-SHA3-512 expansion of the master key into domain-separated subkeys.
kdf
Argon2id password-based key derivation.