How to store your password for code

Posted ktmtwm

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了How to store your password for code相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

How to order your eggs?

How to handle your webdriver exceptions

How to Exceed Your Goals in 2016

How to change your password of your mysql account in WampServer

How to scale out your ClickHouse cluster?

How to Manage your GIT Repository Tutorial