Skip to main content

Module v2

Module v2 

Source
Expand description

Version 2 implementation of the encryption protocol

Same algorithms as v1, but authenticates the header via associated data with domain separation between filename and content encryption. Version 2 of the encryption protocol.

Like v1 it uses XChaCha20-Poly1305 with Argon2id key derivation and an identical header layout (with version byte 2). The difference is that v2 authenticates the header: every AEAD operation binds the fixed header fields (magic, version, salt, KDF parameters, both nonces) as associated data, with distinct domain-separation tags for the filename and the content. This prevents an attacker from swapping the filename and content ciphertexts within a file or tampering with header fields without detection.

This module is deliberately independent of crate::v1: the two formats share no code, so changes to one can never silently alter the other.

Modulesยง

crypt
Encryption and decryption primitives (AAD-authenticated).
file
Encrypted file structures.
file_ops
Encrypted file operations.
header
File header structures and header binding for AAD.
header_ops
File header serialization and deserialization.
key
Key derivation parameters.
key_ops
Key derivation operations.