I try to Encrypt / Decrypt web.config in my Work PC but it was enough I Upload Server, it can not do what I can Encrypt. Below is my code.
protected void Encrypt_Click(object sender, EventArgs e)
{
EncryptConnString();
}
public void EncryptConnString()
{
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection("connectionStrings");
if (!section.SectionInformation.IsProtected)
{
section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
config.Save();
}
}
protected void Decrypt_Click(object sender, EventArgs e)
{
DecryptConnString();
}
public void DecryptConnString()
{
Config ...
Go to the complete details ...