Skip to main content

Module encryption

Module encryption 

Source
Expand description

End-to-end encryption for cloud sync.

Provides passphrase-based key derivation using Argon2id and symmetric encryption using AES-256-GCM. Session message content is encrypted before upload and decrypted after download, ensuring that the cloud service cannot read session contents.

Constants§

KEY_SIZE
Size of the encryption key in bytes (256 bits for AES-256).
NONCE_SIZE
Size of the nonce in bytes (96 bits for AES-GCM).
SALT_SIZE
Size of the salt for key derivation.

Functions§

decode_base64
Decodes base64 data to binary.
decode_key_hex
Decodes a hexadecimal key.
decrypt_data
Decrypts data that was encrypted with encrypt_data.
derive_key
Derives an encryption key from a passphrase and salt using Argon2id.
encode_base64
Encodes binary data as base64.
encode_key_hex
Encodes a key as hexadecimal for storage.
encrypt_data
Encrypts data using AES-256-GCM.
generate_salt
Generates a random salt for key derivation.