Пример #1
0
        public void SerializeDeserialize()
        {
            byte[] serializedBytes   = Symmetric.Serialize(plainText);
            string deserializedValue = Symmetric.Deserialize <string>(serializedBytes);

            Assert.AreEqual(plainText, deserializedValue);
        }
Пример #2
0
        public void EncryptDecryptString_AppendIV()
        {
            var symmetric     = new Symmetric(key);
            var cipher        = symmetric.Encrypt(plainText, iv);
            var decryptedText = symmetric.Decrypt(cipher);

            Assert.AreEqual(plainText, Symmetric.Deserialize <string>(decryptedText));
        }