Generate Initialization Vector (IV) and Salt values in .NET
See the question and my original answer on StackOverflowThe size of the IV is determined by the algorithm you use (for example, 16 bytes). It means the byte array size is fixed, not the string you build from it. You can't pass a string as an IV unless you can convert it to the proper byte array with the required size.