Encrypt your connection strings in a flash


In ASP.NET 2.0 you can now use the aspnet_regiis utility to encrypt and decrypt your connection strings.  Here is an example:
 
My web.config contains the following section
 
<connectionStrings>
 <add name="ORCLR2" connectionString="User Id=hr;Password=xe;Pooling=false;Data Source=ORCL;" providerName="System.Data.OracleClient" />
 </connectionStrings>
 
Open a command prompt and execute the following command:
 
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pef "connectionStrings" "c:\_Apps20\demo\web\"
 
When you need to decrypt then execute the following command:
 
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -pdf "connectionStrings" "c:\_Apps20\demo\web\"
 
ASP.NET 2.0 is awesome!
 
 

About wesmacdonald

Wes MacDonald is a Visual Studio ALM MVP, PSD, MCT and a Principal Consultant for LIKE 10 INC., a SharePoint Server, Visual Studio and Team Foundation Server Consulting Firm providing premium support and guidance services.

2 Responses to “Encrypt your connection strings in a flash”

  1. just wanted to leave my mark behind…that way you would know that someone has been here…i am trying to find someone that grew up in Collingwood Ontario, Canada…you should stop by my space sometime if you think you can help…or if you just want to have a look around…. :o) smiles are free… :o) and contagious… :o) so pass them on… :o) to people you love… :o) and even to those you don\’t… :o)

  2. it is friday and the weekend is so close…i am just out blog surfing to pass a few hours and wanted to leave a comment behind and that way you would know that i have been here…maybe if you have some free time you might stop by my space sometime…i just put in a lot of new pictures of everything over the last few weeks…some of them are pretty cool…looking forward to seeing your comments…..
    :o) smiles are free… :o) and contagious… :o) so pass them on… :o) to people you love… :o) and even to those you don\’t… :o)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: