System.Utilities.Cryptography.Encryption.Decrypt192Byte C# (CSharp) Метод

Decrypt192Byte() публичный статический Метод

Decrypts the specified data using a 192-bit cipher. The key can be any length.
public static Decrypt192Byte ( Stream Data, byte Key ) : byte[]
Data Stream The data to be decrypted.
Key byte The key used to decrypt the data.
Результат byte[]
        public static byte[] Decrypt192Byte(Stream Data, byte[] Key)
        {
            AesCryptoServiceProvider AES = null;
            CryptoStream CS = null;
            try
            {
                //Get the IV and length corrected Key.
                KeyData KeyData = GenerateKeyIV128(Key);
                //Create the AES crytpograhy object.
                AES = new AesCryptoServiceProvider { BlockSize = 192, KeySize = 192, Key = KeyData.Key, IV = KeyData.IV, Mode = CipherMode.CBC, Padding = PaddingMode.PKCS7 };
                CS = new CryptoStream(Data, AES.CreateDecryptor(), CryptoStreamMode.Read);

                var D = new byte[CS.Length];
                CS.Read(D, 0, (int)CS.Length - 1);
                return D;
            }
            finally
            {
                if (AES != null) AES.Clear();
                if (CS != null) CS.Dispose();
            }
        }

Same methods

Encryption::Decrypt192Byte ( byte Data, byte Key ) : byte[]