Expand description
Password-protected storage for HIDE secret keys.
hide-crypto deliberately knows nothing about files or passwords. This crate
adds the at-rest layer: Argon2id stretches a passphrase into a wrapping key,
which seals the 32-byte recipient seed with ChaCha20-Poly1305.
This protects a key file at rest. It is not a hardware-backed vault: while a key is in use it lives in ordinary process memory.
Re-exports§
pub use epoch_store::EpochStore;
Modules§
- epoch_
store - One passphrase-sealed file holding every live epoch secret.
Structs§
- Identity
- A master seed, and the two independent keys derived from it.
Enums§
- KeyFormat
- Whether a stored key needs a passphrase, so a caller can prompt only when needed.
- KeyPurpose
- What a sealed seed is for. Stored in the file so the wrong key cannot be used silently against the right command.
- Keyring
Error
Constants§
- MIN_
ITERATIONS - MIN_
MEMORY_ KIB - And refuse parameters so weak the passphrase is effectively unprotected. The header is authenticated, so this cannot be a downgrade of an honest file; it stops a file written by a careless or hostile implementation from opening without complaint. 8 MiB is the Argon2 RFC 9106 second recommended configuration’s floor for memory-constrained environments.
- MIN_
PASSPHRASE_ LEN
Functions§
- decode_
public - encode_
public - Base64 wrapper so a public key can be pasted into a message or a chat.
- inspect
- normalize_
passphrase - The passphrase exactly as a writer feeds it to Argon2: Unicode NFC.
- open
- Opens a key file and returns the encryption key, whatever shape the file is.
- protect
- Seals
secretunderpassphraseas an encryption-only key. - protect_
identity - Seals a master identity seed, from which both keys derive.
- unprotect
- unprotect_
seed - Opens a sealed seed and reports what it is for, so a caller can refuse a key of the wrong purpose with a message that names the mismatch.