I have some data which I'm encrypting using
Every time I have to encrypt the data, I generate a random nonce of the appropriate size, as well as an empty array for the tag data.
Aes-Gcm, there is an option to provide AAD, or Additional Authenticated Data. To my knowledge, AAD is basically some plaintext data that is authenticated when you decrypt using
Normally I believe you just prepend the nonce in plaintext. However, since the nonce is generated before the encryption is called, I was wondering if you could pass in the nonce as the AAD.
Would this be a security risk? Would it help? Or would it not matter at all?