Skip to main content

Module encryption

Module encryption 

Source
Expand description

Encryption module providing AEAD encryption primitives.

Supports AES-256-GCM (primary) and XChaCha20-Poly1305 (preferred when available).

Structs§

EncryptOptions
Encryption options
EncryptionResult
Result of an encryption operation
Key
256-bit encryption key
X25519KeyPair
X25519 key pair used for Diffie-Hellman key exchange.

Enums§

Algorithm
Supported encryption algorithms

Constants§

X25519_KEY_SIZE
X25519 key size in bytes.

Functions§

decrypt
Decrypt data using AEAD decryption.
decrypt_aes_gcm
Decrypt data using AES-256-GCM
decrypt_bytes
Decrypt data from binary format.
decrypt_with_aad
Decrypt data using AEAD decryption with Additional Authenticated Data.
decrypt_xchacha20
Decrypt data using XChaCha20-Poly1305
derive_key_from_shared_secret
Derive an AES key from raw X25519 shared secret.
derive_key_hkdf
Derive a key using HKDF-SHA256
derive_key_hkdf_raw
Derive raw bytes using HKDF-SHA256.
derive_key_pbkdf2
Derive a key using PBKDF2-HMAC-SHA256
encrypt
Encrypt data using AEAD encryption.
encrypt_aes_gcm
Encrypt data using AES-256-GCM
encrypt_xchacha20
Encrypt data using XChaCha20-Poly1305
generate_key
Generate a random 256-bit encryption key
generate_x25519_key_pair
Generate an X25519 key pair.
x25519_shared_secret
Compute X25519 shared secret.