码迷,mamicode.com
首页 > 其他好文 > 详细

How to store your password for code

时间:2018-12-25 18:09:36      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:key   tor   uil   encrypt   enable   one   web   ack   question   

https://stackoverflow.com/questions/4155187/securing-a-password-in-source-code

Don‘t store you password in your source code, store it in a protected section within you App.Config (or Web.Config).

See Encrypting Configuration File Sections Using Protected Configuration section in this Microsoft Doc

This works by encrypting the encryption keys using built-in Windows stuff, locked to the Mac address and various other undocumented things.

This will even work if you are using more than one server:

... if you are planning to use the same encrypted configuration file on multiple servers, such as a Web farm, only the RsaProtectedConfigurationProvider enables you to export the encryption keys used to encrypt the data and import them on another server.

Using this, if someone wanted to get your password, they would have to first break the Windows security on your server (not impossible, but harder than looking into your IL for the password by far).

How to store your password for code

标签:key   tor   uil   encrypt   enable   one   web   ack   question   

原文地址:https://www.cnblogs.com/ktmtwm/p/10175246.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!