System.Security.Cryptography.RC2CryptoServiceProvider.GenerateIV C# (CSharp) Method

GenerateIV() public method

public GenerateIV ( ) : void
return void
        public override void GenerateIV()
        {
            // Block size is always 64 bits so IV is always 64 bits == 8 bytes
            var iv = new byte[8];
            s_rng.GetBytes(iv);
            IVValue = iv;
        }

Usage Example

 public byte[] GenerateVector()
 {
     while (true)
     {
         rc2.GenerateIV();
         if (UTF8Encoding.UTF8.GetString(rc2.IV).IndexOf("'") == -1 && UTF8Encoding.UTF8.GetString(rc2.IV).IndexOf((char)34) == -1)
         {
             return(rc2.IV);
         }
     }
 }
All Usage Examples Of System.Security.Cryptography.RC2CryptoServiceProvider::GenerateIV