samuel-lucas6 / Geralt

A modern cryptographic library for .NET 8+ based on libsodium and inspired by Monocypher.
https://www.geralt.xyz/
MIT License
48 stars 3 forks source link

Clarify documentation on IncrementalXChaCha20Poly1305 #6

Closed Jack-Edwards closed 1 year ago

Jack-Edwards commented 1 year ago

For encryption, the header is filled with a random nonce. It MUST be prepended to the first ciphertext chunk.

It's my understanding the header should remain detached from the ciphertext. This is how the unit tests behave.

samuel-lucas6 commented 1 year ago

Thanks for highlighting this poor wording. You're correct; I've changed it to the following:

For encryption, the header is filled with a random nonce. It MUST be sent/stored before the sequence of ciphertext messages because it is required to decrypt the stream.

That follows libsodium's phrasing. Feel free to reopen this if you think anything else can be improved :)