Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cryptographic Inventory

This page provides an exhaustive inventory of every cryptographic algorithm used in Open Sesame, where it is used, the key sizes and parameters, and the relevant standards references.

Algorithm Summary

AlgorithmPurposeKey SizeStandardCrate
Argon2idPassword -> password KEK32 bytes outputRFC 9106core-crypto (kdf.rs)
PBKDF2-SHA256Password -> password KEK (governance-compatible)32 bytes outputNIST SP 800-132, RFC 8018core-crypto (kdf.rs)
BLAKE3 derive_keyKey material -> per-purpose keys32 bytes outputBLAKE3 spec (domain-separated KDF mode)core-crypto (derive.rs)
HKDF-SHA256Key material -> per-purpose keys (governance-compatible)32 bytes outputRFC 5869, NIST SP 800-56Ccore-crypto (derive.rs)
AES-256-GCMKey wrapping (WrappedKey, EnrollmentBlob), per-entry vault encryption256-bit keyNIST SP 800-38D, FIPS 197core-crypto (encryption.rs)
OS random sourcePlatform keyring KEK (256-bit), salts, nonces32 bytes (KEK)getrandom(2)core-crypto (random.rs)
AES-256-CBC + HMAC-SHA512SQLCipher page encryption256-bit key (encrypt) + 512-bit key (MAC)FIPS 197, FIPS 198-1SQLCipher (via rusqlite)
X25519Noise IK key agreement256-bit (32 bytes)RFC 7748snow (via core-ipc)
ChaChaPolyNoise IK transport encryption (default)256-bit keyRFC 7539snow (via core-ipc)
BLAKE2sNoise IK hashing (default)256-bit outputRFC 7693snow (via core-ipc)
AES-256-GCM (Noise)Noise IK transport encryption (governance-compatible)256-bit keyNIST SP 800-38Dsnow (via core-ipc)
SHA-256 (Noise)Noise IK hashing (governance-compatible)256-bit outputFIPS 180-4snow (via core-ipc)
BLAKE3Audit log hash chain (default)256-bit outputBLAKE3 speccore-profile
SHA-256Audit log hash chain (governance-compatible)256-bit outputFIPS 180-4core-profile
Ed25519Delegation grant signatures256-bit key (32 bytes)RFC 8032core-types (security.rs)

Argon2id

Standard: RFC 9106

Purpose: Derives the password key-encrypting key (KEK), which wraps the vault’s master key, from a user-supplied password and the vault’s salt. Used by the Password authentication factor (AuthFactorId::Password in core-types/src/auth.rs).

Parameters:

ParameterValueRationale
Memory19 MiB (19,456 KiB)Memory-hard to resist GPU/ASIC attacks
Iterations2Balanced with memory cost for interactive use
Parallelism1Single-threaded derivation
Output32 bytes256-bit AES-256-GCM KEK
Salt16 bytes, per-profile, randomUnique per vault

Implementation: core-crypto/src/kdf.rs, function derive_password_key with KdfAlgorithm::Argon2id.

Known residual: The Argon2id working memory (19 MiB) resides on the unprotected heap during derivation. This is an upstream limitation of the argon2 crate. See GitHub issue #14.

BLAKE3 Key Derivation

Standard: BLAKE3 specification, KDF mode

Purpose: Derives per-purpose keys from key material (a master key, a vault key, a salt, a signature, or factor pieces) using domain-separated context strings. Every context string is declared once, as a KeyContext variant in core-crypto/src/derive.rs.

Context strings used in the system:

Context StringPurposeDerived From
"pds v2 vault-key {profile}"SQLCipher page keyMaster key
"pds v2 ipc-encryption-key {profile}"IPC field encryption keyMaster key
"pds v2 combined-master-key {profile}"Master key of an All-policy vaultFactor pieces
"pds v2 ssh-challenge {profile}"Challenge the SSH agent signsVault salt
"pds v2 ssh-vault-kek {profile}"KEK of the SSH enrollmentChallenge signature
"pds v2 entry-encryption-key"Per-entry AES-256-GCM keySQLCipher page key

Implementation: core-crypto/src/derive.rs, functions derive_key and derive_encryption_key, under the vault’s HkdfAlgorithm (blake3::derive_key for BLAKE3).

BLAKE3’s KDF mode internally derives a context key from the context string, then uses it as keying material with extract-then-expand semantics equivalent to HKDF.

HKDF-SHA256

Standard: RFC 5869, NIST SP 800-56C

Purpose: Governance-compatible alternative to BLAKE3 key derivation. Used when CryptoConfigToml.hkdf = "hkdf-sha256" (core-config/src/schema_crypto.rs).

Implementation: core-crypto/src/derive.rs, the HkdfAlgorithm::HkdfSha256 arm of the derivation. Uses the hkdf crate with sha2::Sha256.

The same context strings listed above for BLAKE3 are used as the HKDF info parameter. No salt is given (RFC 5869 then uses a zero-filled salt). Output is 32 bytes.

AES-256-GCM (Key Wrapping)

Standard: NIST SP 800-38D, FIPS 197

Purpose: Wraps and unwraps the master key under a key-encryption key (KEK) derived from an authentication factor.

Used in:

  • WrappedKey (core-auth/src/wrapped_key.rs) – the master key wrapped under a KEK, in two vault files:
    • <profile>.password-wrap: under the password KEK (the vault’s password KDF, Argon2id or PBKDF2-SHA256);
    • <profile>.keyring-enrollment: under a random 256-bit KEK held in the platform credential store (the Secret Service on Linux).
  • EnrollmentBlob (<profile>.ssh-enrollment) – the master key wrapped under the KEK derived from the SSH agent’s challenge signature.

Parameters:

ParameterValue
Key size256 bits (32 bytes)
Nonce96 bits (12 bytes), random per encryption (EncryptionKey::seal)
Tag128 bits (16 bytes)

AES-256-CBC + HMAC-SHA512 (SQLCipher)

Standard: FIPS 197 (AES), FIPS 198-1 (HMAC), FIPS 180-4 (SHA-512)

Purpose: SQLCipher page-level encryption for vault databases. Each page in the SQLite database is independently encrypted and authenticated.

Parameters:

ParameterValue
EncryptionAES-256-CBC per page
AuthenticationHMAC-SHA512 per page
Key derivationPer-page key from vault key via SQLCipher’s internal KDF
Page size4096 bytes (SQLCipher default)
KDF iterationsControlled by SQLCipher; the vault key itself is pre-derived via Argon2id + BLAKE3

Implementation: SQLCipher via the rusqlite crate with the bundled-sqlcipher feature.

Noise IK (IPC Transport)

Standard: Noise Protocol Framework (noiseprotocol.org), pattern IK

Purpose: All inter-daemon communication on the IPC bus. Provides mutual authentication, encryption, and forward secrecy.

Pattern: IK (Initiator knows responder’s static key)

Default cipher suite: Noise_IK_25519_ChaChaPoly_BLAKE2s

ComponentDefault (LeadingEdge)Governance-Compatible
Key agreementX25519 (RFC 7748)X25519 (RFC 7748)
CipherChaChaPoly (RFC 7539)AES-256-GCM (NIST SP 800-38D)
HashBLAKE2s (RFC 7693)SHA-256 (FIPS 180-4)

Additional binding: The UCred (pid, uid, gid) of the connecting process is bound into the Noise prologue, preventing a process from impersonating another process’s Noise session.

Implementation: core-ipc, using the snow crate. Cipher suite selection is configured via CryptoConfigToml.noise_cipher and CryptoConfigToml.noise_hash in core-config/src/schema_crypto.rs.

Ed25519 (Delegation Signatures)

Standard: RFC 8032

Purpose: Signs DelegationGrant structs to prevent tampering with capability delegations. The 64-byte signature is stored in DelegationGrant.signature (core-types/src/security.rs).

Key size: 256-bit private key, 256-bit public key.

FIPS Path

The following table summarizes FIPS 140 validation status for each algorithm:

AlgorithmFIPS-Validated Implementations AvailableOpen Sesame Profile
Argon2idNo FIPS 140 validation existsLeadingEdge only
PBKDF2-SHA256Yes (multiple vendors)GovernanceCompatible
BLAKE3No FIPS 140 validation existsLeadingEdge only
HKDF-SHA256Yes (via HMAC-SHA256)GovernanceCompatible
AES-256-GCMYes (multiple vendors)Both profiles
AES-256-CBCYes (multiple vendors)Both profiles (SQLCipher)
HMAC-SHA512Yes (multiple vendors)Both profiles (SQLCipher)
X25519Partial (some FIPS modules include it)Both profiles
ChaChaPolyNo FIPS 140 validation existsLeadingEdge only
AES-256-GCM (Noise)Yes (multiple vendors)GovernanceCompatible
BLAKE2sNo FIPS 140 validation existsLeadingEdge only
SHA-256Yes (multiple vendors)GovernanceCompatible
Ed25519Partial (some FIPS modules include it)Both profiles

For deployments requiring full FIPS 140 compliance, set the crypto profile to governance-compatible:

[crypto]
kdf = "pbkdf2-sha256"
hkdf = "hkdf-sha256"
noise_cipher = "aes-gcm"
noise_hash = "sha256"
audit_hash = "sha256"
minimum_peer_profile = "governance-compatible"

This configuration uses only algorithms with widely available FIPS 140-validated implementations. Open Sesame itself is not a FIPS-validated module; the FIPS boundary is at the cryptographic library level.

Crypto Agility

All cryptographic algorithm selections are config-driven via CryptoConfigToml (core-config/src/schema_crypto.rs). The to_typed() method converts string-based configuration into validated CryptoConfig enum variants.

Adding a new algorithm requires:

  1. Adding a variant to the relevant enum in core-types/src/crypto.rs (e.g., KdfAlgorithm::Scrypt).
  2. Adding the string mapping in core-config/src/schema_crypto.rs.
  3. Implementing the algorithm in the corresponding core-crypto function.

The minimum_peer_profile field in CryptoConfig is the floor an installation is to accept from federation peers. It is parsed and validated but read by nothing: federation is not implemented, so it constrains no connection today.

PBKDF2-SHA256

Standard: NIST SP 800-132, RFC 8018

Purpose: Governance-compatible alternative to Argon2id for password-based key derivation. Used when CryptoConfigToml.kdf = "pbkdf2-sha256".

Parameters:

ParameterValue
HashSHA-256
Iterations600,000
Output32 bytes
Salt16 bytes, per-profile, random

Implementation: core-crypto/src/kdf.rs, function derive_password_key with KdfAlgorithm::Pbkdf2Sha256.

PBKDF2-SHA256 provides FIPS 140 compliance for the KDF layer but is significantly less resistant to GPU/ASIC attacks than Argon2id due to its lack of memory-hardness. It should be selected only when FIPS compliance is a hard requirement.