Skip to main content

Crate hide_keyring

Crate hide_keyring 

Source
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.
KeyringError

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 secret under passphrase as 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.