Example #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);
        }
Example #2
0
 /// <summary>
 /// Encrypt a binary blob
 /// </summary>
 /// <param name="msg">The binary "plaintext"</param>
 /// <returns>The binary "ciphertext" with IV and MAC</returns>
 public byte[] EncryptMessage(byte[] msg)
 {
     return(RijndaelEtM.EncryptBinary(msg, EncryptionKey, KeySize.Aes256));
 }