3

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!

4

2 回答 2

4

不。

您可以加密常规部分(由框架提供)或您自己的自定义部分(当实现类/程序集可由 aspnet_regiis 加载时),但不能加密整个 web.config 文件。

有关详细信息,请参阅msdn 。

话说回来; 您可以通过在一个<appSettings>部分中添加所有配置值并对其进行加密来解决此问题,但出于实际原因,我建议您不要这样做。

于 2013-05-23T19:51:44.933 回答
0

具体来说,https: //forums.asp.net/t/1114397.aspx?encrypt+entire+web+config+链接http://aspnet.4guysfromrolla.com/articles/021506-1.aspx,分享:

有一些配置部分不能使用这种技术加密:

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

为了加密这些配置部分,您必须加密该值并将其存储在注册表中。有一个aspnet_setreg.exe命令行工具可以帮助完成这个过程

于 2018-01-18T18:08:27.090 回答