Skip to main content

Crate weirdnet_keys

Crate weirdnet_keys 

Source
Expand description

Key material and key policy: keys, words, shards, derivation, sealing, agreement, MACs, the envelope keyring, dark shards and password exports.

Every operation that encrypts, decrypts, derives, wraps, rotates, recovers, backs up or exports key material lives here, on vetted crates only. Labels come from a Profile; files and the database come in through traits the application implements.

Re-exports§

pub use aead::Sealed;
pub use aead::open;
pub use aead::seal;
pub use password::PasswordSealed;
pub use password::password_open;
pub use password::password_seal;
pub use secrecy;
pub use zeroize;

Modules§

aead
XChaCha20-Poly1305 sealing with a random 192-bit nonce per message.
agefile
Password (scrypt) age files.
dark
Dark shards: shards sealed under a shard password for custodians to hold, plus the claim tag that finds them again. Carrying them between nodes is the protocol’s job.
exchange
X25519 key agreement and HKDF exchange keys.
kdf
Derivation: HKDF-SHA256 and Argon2id.
keyring
Envelope encryption for a database key (envelope.toml + service/v{n}.toml).
mac
HMAC-SHA256 with constant-time verification.
password
Password sealing (Argon2id, then XChaCha20-Poly1305) and password claim tags.
shards
Shamir k-of-n secret sharing of a 256-bit key (vsss-rs over GF(256)).
words
The 24 BIP39 words for a 256-bit key.

Structs§

Key32
A 256-bit secret key, wiped on drop and never printed.
Profile
The labels key operations bind to. Two profiles with different labels derive different keys from the same material, and an envelope written under one is refused by the other.
Zeroizing
Zeroizing is a wrapper for any Z: Zeroize type which implements a Drop handler which zeroizes dropped values.

Enums§

KeysError

Traits§

ExposeSecret
Expose a reference to an inner secret

Functions§

random_bytes
N random bytes from the operating system.

Type Aliases§

Result
SecretString
Secret string type.