Can configuration data be encrypted from the installation process?

I am developing a .NET (2.0) WinForms utility that connects to a SQL Server 2005 database. I found reference materials such as Avoiding Plaintext Passwords to handle the actual encryption of the connection string data. Now I need to implement encryption during the installation process so that the administrator can install this utility on the user's desktop, but not present the user with the database connection information.

The sample code all seem to be for performing encryption in the main application. Thus, the application must be executed once for encryption. If the application is installed but not executed, the configuration information will be in plain text in the configuration file.

Can anyone provide information on how encryption can be done from the setup app. Other approaches to the problem are also welcome (however, due to business requirements, I cannot require Windows authentication to connect to the database - I'm limited to SQL Server authentication).

Edit: I may have been too short because of my description. We have already conducted a risk assessment and determined that using the built-in functions of the .NET framework to encrypt connection information provides sufficient security for the application.

We understand that a truly specific person may end up with information about a connection, and we readily accept this risk. The purpose of encrypting connection data is simply to raise the bar and help "keep honest people honest."

Having already worked out how to perform encryption, I am now trying to work out a way to perform encryption from the installation process. Any help along these lines would be appreciated. Thank!

0


source to share


2 answers


How about the installer starts the postscript process during installation?



This way, it will run during installation and therefore under administrative control, and the code for encritpion will be whatever you like.

+1


source


The main problem with encrypted configuration is protecting the key used to decrypt configuration settings.

With a server application, you can do this by restricting access to the server. The WinForms client application will need to access the key while running as the current user, so the user will be able to find the key if he is smart enough.



If you cannot use Windows Authentication to connect to a database, or use an n-tier architecture with data access code on the server, you will not be protected.

+2


source







All Articles