public void CanDecryptSymmetricTripleDes() { string encrypted = "OTrZQMzbEM2QTfH7vJyaDg=="; ICrypto crypto = new CryptoSym("commonlib.net", new TripleDESCryptoServiceProvider()); string decrypted = crypto.Decrypt(encrypted); Assert.AreEqual("horizonguy", decrypted); }
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); }