Need Encrypted connection string and stmp information in the web.config

为君一笑 提交于 2019-12-02 19:03:14

问题


I want to keep encrypted connection string and stmp information in the web.config.

can I store Connection String and SMTP information in web.config encrypted and where I need just decrypted and use?

OR

What is the point/event where i can encrypt the Connection String and SMTP and save in the web.config? (and if the changes happen in web.config in that, is existing session expired?)

What is the best solution?

Thanks


回答1:


It's easy to do with aspnet_regiis.exe- look at the pe/pd/pef and pdf options. You can also do it programmatically. It works by encrypting a specific configuration section. In your case that is the connectionStrings and smtp sections.

You can use either DPAPI or RSA and you can encrypt on either a machine wide basis or on a specific user account.



来源:https://stackoverflow.com/questions/1321042/need-encrypted-connection-string-and-stmp-information-in-the-web-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!