Beispiel #1
0
        public void AESCrypto_EncryptDecrypt_ReturnsCorrectResult()
        {
            var sut      = new AESCrypto();
            var expected = Guid.NewGuid().ToString();
            var cipher   = sut.EncryptData(expected);
            var actual   = sut.DecryptDataToString(cipher);

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public void AESCrypto_TamperData_AreNotEqual()
        {
            var sut      = new AESCrypto();
            var expected = Guid.NewGuid().ToString();
            var cipher   = sut.EncryptData(expected);

            cipher[0]++;
            var actual = sut.DecryptDataToString(cipher);

            Assert.NotEqual(expected, actual);
        }