Mono Class Library: System.Security.Cryptography.RijndaelManaged Overview | MembersSystem.Security.Cryptography.RijndaelManaged.GenerateIV Method |
Generate a new random Initialization Vector (IV) required for some block cipher modes. [Edit]
|
The IV is used for most SymmetricAlgorithm.Mode of operation (except CipherMode.ECB). The value can be made public and must be available when decrypting the data.
IMPORTANT: If you reuse the same Rijndael object for multiple encryption using the same key it is CAPITAL that you use a different IV each time.
[Edit]
C# Example Rijndael aes = Rijndael.Create (); aes.GenerateKey (); foreach (string file in files) { // each file MUST be encrypted with a different IV aes.GenerateIV (); // encrypt the specified file with our Rijndael key EncryptFile (file, aes); }
Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0