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