在 web.config 中加密连接字符串 [英] Encrypting Connection String in web.config
问题描述
我们如何加密 web.config 文件中的连接字符串部分?
How can we encrypt the connection string section in web.config file?
推荐答案
Rahul,将字符串从 ASCII 转换为 base64 字符串不是加密,这是您的第一个链接所建议的.我们可以轻松地将 base64 转换为 ASCII.
Rahul, converting a string from ASCII to base64 string isn't an encryption, which is what your first link suggests. We can easily convert base64 to ASCII.
将 configsection.protectSection() 与 RSA 密钥一起使用是一种适当的加密,可用于 Web.config 文件的部分.
Using configsection.protectSection() with an RSA key is a proper encryption that is available for sections of the Web.config file.
检查此链接:http://www.beansoftware.com/ASP.NET-Tutorials/Encrypting-Connection-String.aspx
请注意,我们无法在信任级别设置为中等信任的共享托管环境中加密 Web.config 文件.
Please note, that we can not encrypt Web.config file in a shared hosting environment where Trust level is set to medium trust.
这篇关于在 web.config 中加密连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!