Skip to main content

Module encryption

Module encryption 

Source
Expand description

Encryption support for .ald format (§5.1)

Provides AES-256-GCM encryption with two key derivation modes:

  • Password mode: Argon2id KDF for human-memorable passwords
  • Recipient mode: X25519 key agreement for asymmetric encryption

Modules§

mode
Encryption mode byte values

Structs§

EncryptionParams
Encryption parameters for saving

Enums§

DecryptionParams
Decryption parameters for loading
EncryptionMode
Encryption mode configuration

Constants§

NONCE_SIZE
Nonce size for AES-GCM (12 bytes)
SALT_SIZE
Salt size for Argon2id (16 bytes)
TAG_SIZE
AES-GCM authentication tag size (16 bytes)
X25519_PUBLIC_KEY_SIZE
X25519 public key size (32 bytes)

Functions§

decrypt_password
Decrypt data using password-based decryption
decrypt_recipient
Decrypt data using recipient-based decryption
encrypt_password
Encrypt data using password-based encryption (Argon2id + AES-256-GCM)
encrypt_recipient
Encrypt data using recipient-based encryption (X25519 + HKDF + AES-256-GCM)

Type Aliases§

PasswordEncryptResult
Result of password-based encryption: (mode_byte, salt, nonce, ciphertext)
RecipientEncryptResult
Result of recipient-based encryption: (mode_byte, ephemeral_pub_key, nonce, ciphertext)