public void DecryptV1NullTest() { var secretKey = new EncryptionSecret(0, Encoding.UTF8.GetBytes("password")); var cipher = new AesGcmPbkdf10KHexCipher(Encoding.UTF8); var exception = Assert.Throws <StorageCryptoException>(() => cipher.Decrypt(null, secretKey)); Assert.AreEqual("Encrypted text is incorrect", exception.Message); }
public void AesGcm10KHexCipherTest() { var secretKey = new EncryptionSecret(0, Encoding.UTF8.GetBytes("password")); var cipher = new AesGcmPbkdf10KHexCipher(Encoding.UTF8); var decryptedMessage = cipher.Decrypt(CipherMessageV1, secretKey); Assert.AreEqual("InCountry", decryptedMessage); Assert.Throws <NotImplementedException>(() => cipher.Encrypt("text")); }