Decrypt parameter with C# API

Hello experts!

I use a configuration parameter, which I marked as "Encrypted" in Designer. In Web Designer component I need to get this parameter as clear value. There are posts on the forum where people decrypt parameters with VB, but i need to decrypt (and possibly encrypt) with C# inside Code Snippet in Web Designer.

How can I do this?

Thanks!

Parents
  • One potential workaround is not to use config parms. Instead, decrypt web.config, add you parameter in the connectionStrings section (t<add name="myParm" connectionString="This script is encrypted using aspnet_regiis" />, then encrypt web.config it again. Using a backend script (which can be invoked from the front end), you can now use the variable from the front end

    look at aspnet_regiis.exe to see how you can encrypt/decrypt web.config. E.g. 

    aspnet_regiis.exe -pe "connectionStrings" -app <appName>

    The downside of this ofcourse is that you cannot use config parms to change the value, so each time there is a change the web.config needs to be decrypted, changed and encrypted again.

Reply
  • One potential workaround is not to use config parms. Instead, decrypt web.config, add you parameter in the connectionStrings section (t<add name="myParm" connectionString="This script is encrypted using aspnet_regiis" />, then encrypt web.config it again. Using a backend script (which can be invoked from the front end), you can now use the variable from the front end

    look at aspnet_regiis.exe to see how you can encrypt/decrypt web.config. E.g. 

    aspnet_regiis.exe -pe "connectionStrings" -app <appName>

    The downside of this ofcourse is that you cannot use config parms to change the value, so each time there is a change the web.config needs to be decrypted, changed and encrypted again.

Children
No Data