Skip to main content

Module secret

Module secret 

Source
Expand description

Arbitrary-secret records (passwords, API tokens, notes) stored in the vault. Arbitrary-secret records (passwords, API tokens, notes) stored in the vault alongside curve-key records.

The vault below the record model is already secret-agnostic: the storage backend is a plain encrypted key-value store and crate::crypto encrypts arbitrary bytes, so storing generic secrets is an additive extension rather than a new subsystem. A SecretRecord is bincode-serialized as a whole – name, kind, AND the plaintext value – then encrypted under the vault data key at rest (see crate::storage::Storage::store_secret), so entry titles are encrypted, not just the value. The plaintext value exists decrypted only in memory and is scrubbed on drop.

Structs§

SecretRecord
A stored arbitrary secret sitting alongside curve-key records in the vault.
ThresholdSeal
The threshold seal that gates a secret’s VALUE behind a t-of-n OPRF quorum.

Enums§

SecretKind
Category of a stored secret. Additive: only APPEND new variants, so a record written by an older build keeps decoding under bincode’s integer tag.

Functions§

seal_value
Seal plaintext under a fresh per-secret DEK and wrap that DEK under oprf_key (the t-of-n OPRF-quorum-derived key). Returns the value ciphertext (to store as the record’s value) and the matching ThresholdSeal (to store alongside). oprf_id/epoch are recorded in the seal so the quorum can later re-derive the same key, and are bound into both ciphertexts as AAD.
unseal_value
Recover a sealed secret’s plaintext from value_ciphertext given its ThresholdSeal and the OPRF-quorum-derived key. Fails if oprf_key is wrong (a single-device caller that never assembled the quorum cannot derive it) or if the seal’s bound oprf_id/epoch were tampered with: either way the AEAD tag check fails and the value stays sealed.