Exemple #1
0
        public void EncryptedDataWithPasswordBytes()
        {
            var encryptedData       = new EncryptedDataWithPassword(Encoding.UTF8.GetBytes(TestString), TestPassword);
            var encryptedDataString = encryptedData.ToString();
            var decryptedTestBytes  = EncryptedDataWithPassword.DecryptDataAsBytes(encryptedDataString, TestPassword);

            Assert.AreEqual(TestString, Encoding.UTF8.GetString(decryptedTestBytes));
        }
Exemple #2
0
        public void EncryptedDataWithPasswordString()
        {
            var encryptedData       = new EncryptedDataWithPassword(TestString, TestPassword);
            var encryptedDataString = encryptedData.ToString();

            var decryptedTestString = EncryptedDataWithPassword.DecryptData(TestPassword, encryptedDataString);

            Assert.AreEqual(TestString, decryptedTestString);
        }