How do I avoid having the database password stored in plaintext in sourcecode?

前端 未结 6 1594
情书的邮戳
情书的邮戳 2021-01-01 12:17

In the web-application I\'m developing I currently use a naive solution when connecting to the database:

Connection c = DriverManager.getConnection(\"url\",          


        
6条回答
  •  别那么骄傲
    2021-01-01 12:36

    You can store the connection string in Web.config or App.config file and encrypt the section that holds it. Here's a very good article I used in a previous project to encrypt the connection string:

    http://www.ondotnet.com/pub/a/dotnet/2005/02/15/encryptingconnstring.html

提交回复
热议问题