public override void Configure(IDictionary <string, string> settings) { string conn = settings[Environment.ConnectionString]; DesEncryptor des = new DesEncryptor(); settings[Environment.ConnectionString] = des.Decrypt(conn); base.Configure(settings); }
public void Core_Security_Cryptography_DesEncryptor() { var rawData = "Hello, I am raw"; var encryptor = new DesEncryptor(rawData); var encrypted = encryptor.Encrypt(rawData); Assert.IsTrue(rawData != encrypted); Assert.IsTrue(encryptor.Decrypt(encrypted) == rawData); }