pub struct StretchedMaster { /* private fields */ }Expand description
A high-entropy 32-byte master for ALL of a user’s key derivations — the
per-audience AEAD keys AND the X25519/Ed25519 identities derive from THIS (via
HKDF), never from a raw passphrase. The type is the gate: an identity or
audience key cannot be derived from an unstretched password, because those
functions take &StretchedMaster, and the only ways to build one are the two
constructors below.
Implementations§
Source§impl StretchedMaster
impl StretchedMaster
Sourcepub fn from_passphrase(passphrase: &[u8], user_id: &str) -> Self
pub fn from_passphrase(passphrase: &[u8], user_id: &str) -> Self
Argon2id-stretch a (password-equivalent) passphrase into the master,
deterministically per user (see [argon2_salt]).
SECURITY — mitigation, NOT closure: this raises the per-guess cost of a weak
passphrase but cannot mint entropy it never had. The user’s identity PUBLIC
key is published (the platform maps account_id → pubkey), which is an
OFFLINE verification oracle — an attacker guesses a passphrase, stretches,
derives, and compares to the published key with NO network. Argon2id’s
per-guess cost is then the entire wall; a short password still falls. A PAKE
removes the oracle and is the strictly stronger path. Passphrase policy,
param benchmarking, and the PAKE alternative still require a cryptographer
before production.
Sourcepub fn from_issued_high_entropy(secret: &[u8], user_id: &str) -> Self
pub fn from_issued_high_entropy(secret: &[u8], user_id: &str) -> Self
From a Parslee-issued high-entropy secret (the caller CERTIFIES it is
≥256-bit). Skips Argon2id — stretching a strong key is pointless cost —
and HKDF-binds it to user_id for per-user domain separation.
Sourcepub fn profile(&self) -> KdfProfile
pub fn profile(&self) -> KdfProfile
The profile that minted this master (for the rotation/migration machinery).