Simone Errico
Simone Errico

Reputation: 109

Use of AAD from AES-GCM

I'm working on a for-fun cryptography project in Java. I'm struggling trying to understand Additional Associated Data use. From Cipher documentation and further online research I understood that AAD are appended to encrypted data and authenticated, but not encrypted. So, they should be readable without encrytpion key. But I can't understand how, since they seem to be retrieved after cipher initialization, that requires encryption key! Can someone help me? Thank you all in advance!

Upvotes: 3

Views: 4957

Answers (1)

Simone Errico
Simone Errico

Reputation: 109

Ok, I finally caught it. AAD are provided to the cipher but do not become part of cipher output! So I must store and handle them separately. Then, when I start decrypting, if they have been corrupted decryption will not work. Now I have everything clear. I'm sorry to have wasted your time :)

Upvotes: 7

Related Questions