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§
- Encryption
Params - Encryption parameters for saving
Enums§
- Decryption
Params - Decryption parameters for loading
- Encryption
Mode - 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§
- Password
Encrypt Result - Result of password-based encryption: (mode_byte, salt, nonce, ciphertext)
- Recipient
Encrypt Result - Result of recipient-based encryption: (mode_byte, ephemeral_pub_key, nonce, ciphertext)