Skip to main content

Crate firecloud_crypto

Crate firecloud_crypto 

Source
Expand description

FireCloud Crypto - Encryption and key management

Implements the key hierarchy:

  • Master Key (derived from password via Argon2id)
  • Key Encryption Key (KEK) - encrypts per-file DEKs
  • Data Encryption Key (DEK) - per-file symmetric key

Structs§

DerivedKeys
Keys derived from master key using HKDF
EncryptedDek
Encrypted DEK stored in file manifest
Kek
Key Encryption Key derived from user password
KeyPair
Ed25519 key pair for signing and identity
MasterKey
Master key derived from user password

Enums§

CryptoError

Constants§

KEK_NONCE_SIZE
Size of nonce for XChaCha20 (192-bit)
KEK_SIZE
Size of KEK in bytes (256-bit)
KEY_SIZE
Key size (256 bits)
NONCE_SIZE
Nonce size for XChaCha20-Poly1305 (24 bytes)
SALT_SIZE
Size of salt for password hashing (128-bit)
TAG_SIZE
Authentication tag size for Poly1305

Functions§

decrypt
Decrypt data encrypted with XChaCha20-Poly1305
encrypt
Encrypt data using XChaCha20-Poly1305
generate_dek
Generate a random Data Encryption Key (DEK) for a file
generate_salt
Generate a random salt for password hashing
hash_password
Hash a password for storage (verification only, not for encryption)
verify_password
Verify a password against a stored hash

Type Aliases§

CryptoResult