Question

I know you can encrypt appSettings and connectionStrings and other individual sections in web.configs using aspnet_regiis, but how does one encrypt an entire web.config?

I have a client requesting that we encrypt the complete web.config file, but I tried to encrypt section "configuration" but it says section 'configuration not found.

If you can't do it this way, is there some other similarly easy to do so without having to pull in third-party apps to do it?

Thanks!

Was it helpful?

Solution

No.

You can encrypt the regular sections (provided by the framework), or your own custom sections (when the implementing class/assembly is loadable by aspnet_regiis), but not the whole web.config file.

See the msdn for more details.

Having said that; you may be able to work around this by adding al your configuration values in an <appSettings> section and encrypting that, but i would recommend against that for practical reasons.

OTHER TIPS

Specifically, https://forums.asp.net/t/1114397.aspx?encrypt+entire+web+config+ links http://aspnet.4guysfromrolla.com/articles/021506-1.aspx, sharing:

There are some configuration sections that you cannot encrypt using this technique:

<processModel>
<runtime>
<mscorlib>
<startup>
<system.runtime.remoting>
<configProtectedData>
<satelliteassemblies>
<cryptographySettings>
<cryptoNameMapping>
<cryptoClasses>

In order to encrypt these configuration sections you must encrypt the value and store it in the registry. There's an aspnet_setreg.exe command-line tool to help along with this process

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top