Esempio n. 1
0
        private static RijndaelManaged CreateAES(SingleUseAESKey singleUseKeyData)
        {
            RijndaelManaged AES = new RijndaelManaged();

            AES.BlockSize = Settings.AES.BlockBits;
            AES.Key       = singleUseKeyData.Key;
            AES.IV        = singleUseKeyData.IV;
            AES.Padding   = PaddingMode.PKCS7;
            AES.Mode      = CipherMode.CBC;
            return(AES);
        }
Esempio n. 2
0
 public static CryptoStream CreateEncryptionStream(Stream BaseStream, SingleUseAESKey singleUseKeyData)
 {
     return(new CryptoStream(BaseStream, CreateAES(singleUseKeyData).CreateEncryptor(), CryptoStreamMode.Write));
 }