I want to use AES GCM to encrypt data at rest. When retrieving the data, I want to make sure that the key is valid and the data has not been tempered with. Can I store the nonce/iv along with the ciphertext in the database?
1 Answer
Absolutely. There is no risk from appending the nounce/iv to encrypted text.
-
> There is know risk from appending the nounce/iv to encrypted text. Did you mean there is no risk?– macheteMay 28, 2016 at 23:17
-
-
@machete It's funny that you pointed out a spelling error when you wrote "tempered" instead of "tampered"! Mar 29, 2018 at 1:48
-
@cj-dennis what is really funny is you picking on a two year old question with a senseless comment like that. There is a huge difference between „no“ and „known“ security vulnerability (in case you didn’t notice). Obviously it’s important to sort that out, which happened. Thank you for your contribution though...– macheteMar 29, 2018 at 12:31
-
1@machete It doesn't matter how old the question is. I had the same question today, which is how I found yours. Two other people have already found your question useful and who knows how many people might visit this question in the future. If I don't know what "nonce" means, I might think that there is a technical term called "tempering the data". It's best to be clear, as you discovered yourself. ;-) Mar 29, 2018 at 12:49