public void IsEncryptSymmetricTripleDesDifferentByInput() { ICrypto crypto = new CryptoSym("commonlib.net", new TripleDESCryptoServiceProvider()); string encrypted = crypto.Encrypt("horizonguy"); string encrypted2 = crypto.Encrypt("bourneIdentity"); Assert.AreNotEqual("horizonguy", encrypted); Assert.AreNotEqual(encrypted, encrypted2); }
public void CanEncryptSymmetricTripleDes() { ICrypto crypto = new CryptoSym("commonlib.net", new TripleDESCryptoServiceProvider()); string encrypted = crypto.Encrypt("horizonguy"); Assert.AreNotEqual("horizonguy", encrypted); }
public void CanEncryptWithSpecialCharsTripleDes() { string plainText = "~`!@#$%^&*()_+{}|:\"<>?[]\\,./;'-="; ICrypto crypto = new CryptoSym("commonlib.net", new TripleDESCryptoServiceProvider()); string encrypted = crypto.Encrypt(plainText); Assert.AreNotEqual(plainText, encrypted); // Now decrypt. string decrypted = crypto.Decrypt(encrypted); Assert.AreEqual("~`!@#$%^&*()_+{}|:\"<>?[]\\,./;'-=", decrypted); }