简体   繁体   中英

How can I obfuscate database authentication info during open-source development?

I'm working on an open-source web application that will retrieve and display data from a database whose authentication info I would like to keep under wraps, but at the same time, I would like anyone to be able to view and contribute to the source code. The idea is that we don't want the database to be used for profit.

Is there a way to make the database schema public, but only have a few rows of each table actually visible outside of the production server? I'm using ASP.NET MVC 4 in Visual Studio 2012, hosting the code on git, and publishing to Windows Azure. I'm also using a pre-existing Microsoft Access 2007 database.

You could encrypt the connectionStrings section of the Web.config file.

How you do that is described here . The connectionStrings section would not be decryptable on any machine except the server. It would be rather inconvenient for other developers though. You could set up so that this connection string is only used when the web site is published using transforms .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM