示例#1
0
        public void BinaryBlob()
        {
            var plainblob = UTF8Encoding.UTF8.GetBytes(Plaintext);

            var cipherblob  = RijndaelEtM.EncryptBinary(plainblob, Password, KeySize.Aes128);
            var plainresult = RijndaelEtM.DecryptBinary(cipherblob, Password, KeySize.Aes128);

            Assert.Equal(plainblob, plainresult);
        }
示例#2
0
 /// <summary>
 /// Decrypt a binary blob
 /// </summary>
 /// <param name="msg">The binary "ciphertext" with IV and MAC</param>
 /// <returns>The binary "plaintext"</returns>
 public byte[] DecryptMessage(byte[] msg)
 {
     return(RijndaelEtM.DecryptBinary(msg, EncryptionKey, KeySize.Aes256));
 }