你应该加密您的Connection Strings
存储在配置文件中。
使用ASPNET_REGIIS.EXE中发现:开始 - > Visual Studio中 - > Visual Studio工具 - > Visual Studio命令提示符
运行以下命令:
aspnet_regiis –pef connectionStrings c:\PathToWebSite
如果上述命令不起作用尝试
aspnet_regiis -pe connectionStrings -app "/" -site n
其中n
是在IIS中报告的网站的站点ID。
现在,如果你Connection String
部分将被加密:
<connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>Bf677iFrUFW ... +4n4ZZKXCTUAu2Y=</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>UDEZ ...QfXUmM5rQ==</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
欲了解更多信息: