Generate a new random Initialization Vector (IV) required for some block cipher modes.
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 TripleDES object for multiple encryption using the same key it is CAPITAL that you use a different IV each time.
C# Example
TripleDES tdes = TripleDES.Create (); tdes.GenerateKey (); foreach (string file in files) { // each file MUST be encrypted with a different IV tdes.GenerateIV (); // encrypt the specified file with our TripleDES key EncryptFile (file, tdes); }
Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0