在web.config中加密appSettings [英] Encrypting appSettings in web.config
问题描述
我正在开发一个需要使用用户名和密码存储在web.Config中的网络应用程序,它还引用了网络应用程序本身请求的一些URL,而不是客户端。
我知道.Net框架不会允许提供一个web.config文件,但是我仍然认为它的不良做法是以纯文本形式保留这种信息。
到目前为止,我读过的一切都需要我使用命令行开关或在服务器的注册表中存储值。我可以访问这两个,因为主机是在线的,我只有FTP和控制面板(舵)访问。
任何人都可以推荐任何好的,免费的加密DLL或我可以使用的方法?感谢您收到的反馈意见,但我无法发出命令,无法编辑注册表。它必须是一个加密工具/帮助器,但只是想知道哪一个!
- < a href =http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx =noreferrer>在MSDN上加密和解密配置部分(ASP.NET)
- 在ASP中加密Web.Config值。 .NET 2.0 上关于ScottGu的博客
- 加密自定义配置部分 K. Scott Allen的< a href =http://codetocode.com/Blogs/scott/default.aspx =noreferrer>博客
编辑:
如果不能使用asp实用工具,可以使用 SectionInformation.ProtectSection 方法。
代码项目示例:
在ASP.Net 2.0中的Web.config内加密连接字符串
I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.
I know the .Net framework will not allow a web.config file to be served, however I still think its bad practice to leave this sort of information in plain text.
Everything I have read so far requires me to use a command line switch or to store values in the registry of the server. I have access to neither of these as the host is online and I have only FTP and Control Panel (helm) access.
Can anyone recommend any good, free encryption DLL's or methods which I can use? I'd rather not develop my own!
Thanks for the feedback so far guys but I am not able to issue commands and and not able to edit the registry. Its going to have to be an encryption util/helper but just wondering which one!
- Encrypting and Decrypting Configuration Sections (ASP.NET) on MSDN
- Encrypting Web.Config Values in ASP.NET 2.0 on ScottGu's blog
- Encrypting Custom Configuration Sections on K. Scott Allen's blog
EDIT:
If you can't use asp utility, you can encrypt config file using SectionInformation.ProtectSection method.
Sample on codeproject:
Encryption of Connection Strings inside the Web.config in ASP.Net 2.0
这篇关于在web.config中加密appSettings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!