我在这些链接上查看MS文档:https://msdn.microsoft.com/en-us/library/dtkwfdky.aspx https://msdn.microsoft.com/en-us/library/hh8x3tas.aspx
文档说明如下:
既然ASP.NET应用程序的标识具有对默认RsaProtectedConfigurationProvider对象的RSA密钥容器的读访问权限,您将使用该密钥容器加密ASP.NET应用程序的Web.config文件的各个部分 .
这似乎意味着Web.config文件中的受保护部分将通过RSA加密,在示例XML代码中,我确实看到以下代码
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
但是,我也看到以下代码,这似乎表明TDES-CBC被用作密码:
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
正在使用哪些密码来加密哪些数据?
1 回答
引用各种文档:
您可以指定自己的受保护配置提供程序,也可以使用ASP.NET中内置的提供程序之一 .
默认情况下, Machine.config 文件指定以下受保护的配置提供程序[包含在.NET Framework中]:
DpapiProtectedConfigurationProvider . 使用Windows数据保护API(DPAPI)加密和解密数据 .
RsaProtectedConfigurationProvider . Uses the RSA encryption algorithm 加密和解密数据 . [默认 . ]
https://msdn.microsoft.com/en-us/library/68ze1hb2(v=vs.100).aspx
"In some cases, you might need to encrypt information using an algorithm other than those available with the RSA or DPAPI providers." https://msdn.microsoft.com/en-us/library/wfc2t3az(v=vs.100).aspx
TripleDES提供商样本:https://msdn.microsoft.com/en-us/library/system.security.cryptography.tripledescryptoserviceprovider(v=vs.100).aspx