Skip to main content

Module encryption

Module encryption 

Source
Expand description

Encryption module providing AEAD encryption primitives.

Supports XChaCha20-Poly1305 (the high-level default) and explicit AES-256-GCM.

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§

HKDF_SHA256_MAX_OUTPUT
Maximum HKDF-SHA256 output permitted by RFC 5869 (255 * HashLen).
PBKDF2_MAX_ITERATIONS
Maximum synchronous PBKDF2 work factor accepted by Voided.
PBKDF2_MAX_SALT_SIZE
Maximum salt size accepted by password-based derivation.
PBKDF2_MIN_ITERATIONS
Minimum PBKDF2-HMAC-SHA256 work factor accepted by the high-level API.
PBKDF2_MIN_SALT_SIZE
Minimum salt size accepted by password-based derivation.
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 a 256-bit AEAD key from a 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.
validate_pbkdf2_parameters
Validate the bounded policy used by Voided’s synchronous PBKDF2 APIs.
x25519_shared_secret
Compute X25519 shared secret.