Skip to main content

Module aead

Module aead 

Source
Expand description

XChaCha20-Poly1305 authenticated encryption of the payload.

The payload is compressed before it is encrypted, never the other way round: ciphertext is indistinguishable from random and therefore incompressible, so compressing afterwards would cost time and save nothing. Compressing first also shrinks what has to be embedded, which directly lowers the bits per pixel the embedding layer needs — the single most important factor in staying invisible to steganalysis.

Structs§

XChaCha20Poly1305Cipher
The production cipher: XChaCha20-Poly1305.

Enums§

AEADError
Failures of the authenticated encryption primitive.
CryptoError
Failures of the combined compression and encryption stages.

Traits§

AEADCipher
Authenticated encryption with associated data.

Functions§

compress_and_encrypt
Compresses plaintext with Zstandard and then encrypts the result.
decrypt_and_decompress
Decrypts ciphertext and decompresses the authenticated result.