Skip to main content

Module crypto

Module crypto 

Source
Expand description

Secrets, derived keys, signing, encryption, hashing and password hashing. See docs/concepts/03-security.md.

Structs§

Argon2id
argon2id with OWASP parameters: 19 MiB, t=2, p=1.
Hash
SHA-256 digest. Stored instead of tokens.
Keys
Keys derived from the configured secrets. The first secret signs and encrypts; every secret verifies and decrypts, so secrets rotate without signing anyone out.
Passwords
Runs a PasswordHasher on the blocking pool behind a semaphore, so a burst of sign-ins can’t allocate unbounded argon2 memory.
Secret
A master secret. Zeroized on drop; never printed.

Enums§

SignPurpose

Traits§

PasswordHasher
Password hashing. Runs on a blocking thread; see Passwords.

Functions§

base64url
base64url_decode
ct_eq
Constant-time string equality.
random_bytes
random_string
A random string from alphabet, without modulo bias.
random_token
32 random bytes as base64url (43 chars): session tokens, verification values, state.