Ejemplo n.º 1
0
        public void EncryptingThenDecryptingReturnsOriginalResult()
        {
            var sut = new RijndaelEncryptor(PASSWORD, SALT);

              var encrypted = sut.Encrypt(cleartext);
              var decrypted = sut.Decrypt(encrypted);

              Assert.AreEqual(cleartext, decrypted);
        }
Ejemplo n.º 2
0
        public void SameResultWithDifferentInstances()
        {
            var sut1 = new RijndaelEncryptor(PASSWORD, SALT);
              var encrypted = sut1.Encrypt(cleartext);

              var sut2 = new RijndaelEncryptor(PASSWORD, SALT);
              var decrypted = sut2.Decrypt(encrypted);

              Assert.AreEqual(cleartext, decrypted);
        }