Score:1

XChaCha20-Poly1305 vs Plain ChaCha20-Poly1305 performance

kn flag

I know that the security of both are the same (only nonce size is different). But which one is faster and better to use, when encrypting a lot of files (500+, from 1MB to 200MB)?

kelalaka avatar
in flag
Do you want us to try these performances? Of course, xChaCha20-Poly1305 is better since it [enables longer nonces so that random nonces are secure](https://crypto.stackexchange.com/a/87347/18298)
Score:5
bs flag

ChaCha20-Poly1305 is slightly more performant because there's no HChaCha20 subkey derivation. If you benchmark the two, this will be detectable. However, in the real world, the difference is negligible.

If you don't need random nonces, use ChaCha20-Poly1305 (the IETF version). Otherwise, or when unsure, use XChaCha20-Poly1305 with a random nonce each time. Just don't let the nonce repeat for a given key with either.

File encryption is often done with a unique key per file and a counter nonce that gets incremented for each chunk (e.g. the STREAM construction). This prevents chunk reordering easily. I discussed this in more detail here.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.