Skip to content

samuel-lucas6/kcChaCha20-Poly1305

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

License: MIT

kcChaCha20-Poly1305

A key-committing implementation of ChaCha20-Poly1305.

This technique is an encryption version of the padding fix discussed in How to Abuse and Fix Authenticated Encryption Without Key Commitment. Credit goes to Loup Vaillant for the idea.

The latter 32 bytes of block 0 (after the Poly1305 key) are prepended to the ciphertext as a commitment. For decryption, this commitment is checked in constant time alongside the tag, eliminating a timing difference.

This provides 128-bit key-committing security but incurs additional storage overhead. If combined with the Hash-then-Encrypt strategy (subkey = KDF(masterKey, nonce || associatedData), this should commit to all inputs.