Expand description
Password-based key wrapping: Argon2id derives a wrapping key from a passphrase / recovery code, which then seals a secret under AES-256-GCM. Used for the master-key escrow and backup wrap key (SSoT: Cryptography — Primitives § Password-based KDF).
Argon2id runs only at account recovery and device bootstrap — never on a hot path. The cost parameters are recorded inside the wrapped blob, so a desktop-wrapped blob unwraps correctly on a phone (slowly) and vice versa, and parameters can be raised over time without a flag day.
Structs§
- Wrapped
Secret - A secret sealed under a passphrase-derived key, self-describing for unwrap.
Functions§
- derive_
wrap_ key - Derive a 32-byte wrapping key from a passphrase and salt via Argon2id. Exposed so the backup artifact can use one passphrase-derived key for both its MANIFEST HMAC and its AMK-ledger seal (SSoT: Backup — Master-Key Escrow).
- unwrap
- Unwrap a
WrappedSecret, re-deriving the wrapping key from the in-band parameters. ReturnsCryptoError::Authon a wrong passphrase or a corrupt/tampered blob. - wrap
- Wrap
secretunderpassphraseusing the canonical parameters fortier. - wrap_
with - Wrap
secretunderpassphrasewith explicit Argon2id parameters (recorded in-band).