简体   繁体   中英

Where should I store the IVs for encrypted records?

I'd like to encrypt some secret data before I store them in my database. RijndaelManaged seems a good option for this, but if I understand well, I need to generate a new IV for every single time when I encrypt something. So, where should I store these? Is it a good idea to concatenate the initialization vector and the encrypted value?

The IV is not secret, you can store it anywhere you like. You can certainly store it in front of the ciphertext.

It is a good idea to have an IV, too, although it is optional in some cipher modes. I would use it whenever possible because it mitigates some attacks in certain situations. "Layman" cryptographers like us should play it very safe.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM