Skip to main content

Module decryption

Module decryption 

Source
Expand description

AES Crypt v0–v3 decryption surface.

decrypt() is the high-level entry point and handles every supported format version. The lower-level helpers — header parsing, extension consumption, session-block recovery, and the streaming CBC loop — are exposed so that callers integrating with custom containers can drive each stage themselves.

§Compatibility

§Security

See decrypt() for the decrypt-then-verify caveat: the v3 payload HMAC is checked only after the ciphertext stream has been processed, so partial unauthenticated plaintext may be written to the output before an error is returned. Callers must discard or overwrite the output on error.

Enums§

StreamConfig
Per-version configuration for decrypt_ciphertext_stream.

Functions§

consume_all_extensions
Consumes all v2/v3 extension blocks from reader, stopping at the zero-length terminator.
decrypt
Decrypts an AES Crypt v0–v3 file streamed from input and writes the recovered plaintext to output.
decrypt_ciphertext_stream
Streams ciphertext from input_reader through AES-256-CBC decryption, writes the recovered plaintext to output_writer, and verifies the version-appropriate HMAC trailer.
extract_session_data
Recovers the session IV and session key from the file header into the caller’s pre-allocated secure-gate buffers.
read_exact_span
Reads exactly N bytes from reader into a fresh auto-zeroizing SpanBuffer<N>.
read_file_version
Reads and validates the 5-byte AES Crypt file header.
read_kdf_iterations
Reads the 4-byte big-endian PBKDF2 iteration count from a v3 file header.