Exemplo n.º 1
0
        public void EncryptFact()
        {
            var key       = default(byte[]);
            var iv        = default(byte[]);
            var encrypted = KandaRijndaelManaged.Encrypt(@"a", out key, out iv);

            var decrypted = Encoding.Unicode.GetString(encrypted);

            Assert.NotEmpty(decrypted);
        }
Exemplo n.º 2
0
        public void DecryptFact()
        {
            const string PLAIN_TEXT = @"a";

            var key       = default(byte[]);
            var iv        = default(byte[]);
            var encrypted = KandaRijndaelManaged.Encrypt(PLAIN_TEXT, out key, out iv);

            var plainText = KandaRijndaelManaged.Decrypt(encrypted, key, iv);

            Assert.Equal(PLAIN_TEXT, plainText);
        }