Search code examples
c#.netsecurityencryptionaes

AES Initialization Vector alongside cipher text


Is it safe to concat IV and cipher text and store it as a single entity, like a varchar row in SQL database? I use AES-256, block size 128 bits, CBC mode


Solution

  • Yes. The Wikipedia article on this is a recommended read. In short the IV is not a second key so it is harmless (and usually necessary) to include it.

    https://en.wikipedia.org/wiki/Initialization_vector?wprov=sfla1