Skip to main content

Module high_entropy_secret

Module high_entropy_secret 

Source
Expand description

A high-entropy secret is a wrapper around secret bytes that are guaranteed to be high-entropy, and therefore safe to use as input keying material for a cheap KDF (such as the one used by the crate::safe::SecretProtectedKeyEnvelope).

Examples of high-entropy secrets are a random URL-fragment secret, a derived key, or random bytes. They are unlike low-entropy secrets such as PINs or passwords, which can be brute-forced and therefore require a memory- or compute-hard KDF.

Structs§

HighEntropySecret
A secret that is guaranteed to be high-entropy, and therefore safe to use as input keying material for a cheap KDF.

Enums§

HighEntropySecretError
Errors that can occur when constructing a HighEntropySecret.

Constants§

MIN_SECRET_LENGTH 🔒
Minimum accepted secret length in bytes. 16 bytes = 128 bits of headroom for a uniformly random secret, matching the security level a cheap KDF assumes.

Traits§

HighEntropySecretSource
A high entropy secret, generated from a CSPRNG or derived from a high-entropy key. This MUST NOT be: