[botan-devel] Understanding authentication in two-pass authenticated encryption algorithms
jonespd at tutanota.com
Mon Dec 2 19:15:52 EST 2019
Hopefully I am posting in an appropriate place with a relevant question. I am new to this and want to be sure I am using the library correctly.
In my understanding, two pass authentication algorithms (I'm currently trying out "AES-256/EAX") provide two passes on decryption where the first pass validates the authentication tag and the second pass decrypts only if the message is authenticated. With this, as I understand, usage where authentication fails should not give an attacker any visibility into any decryption output before the tag is authenticated. That seems highly desirable and worth a penalty compared to single-pass algorithms that are faster if the application allows for this.
Now I'm trying to reconcile this understanding with the Botan AEAD_Mode API that has start(), update(), and finish() with large messages that do not comfortably fit in memory. I see a note in the documentation that touches on this and explains that start() can be followed with finish() and the memory buffer can be immediately discarded if finish fails with a tag authentication error. However, what about the case where I want to decrypt in chunks using update(), read from disk, where the content is very large and don't want to attempt loading it all into one memory buffer? Is there a way to authenticate such large content before streaming out decryted data for an attacker to see only to discover the error on the finish() call?
Hopefully that is understandable. Thanks for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the botan-devel