public void Rijndael_EncryptionDecryptionTest(string plainText) { //Arrange ICryptoEngine cryptoEngine = new RijndaelCryptoEngine(); //Act var cipherText = cryptoEngine.Encrypt(plainText, encryptionKey); var decipher = cryptoEngine.Decrypt(cipherText, encryptionKey); //Assert Assert.AreEqual(plainText, decipher, "Encryption / Decryption failed"); }
public void Aes_Rijndael_EncryptionDecryptionTest(string plaintText) { //Arrange ICryptoEngine cryptoEngine1 = new AesCryptoEngine(); ICryptoEngine cryptoEngine2 = new RijndaelCryptoEngine(); //Act var cipherText = cryptoEngine1.Encrypt(plaintText, encryptionKey); var decipherText = cryptoEngine2.Decrypt(cipherText, encryptionKey); //Assert Assert.AreEqual(plaintText, decipherText, "Both algorithms work differe"); }