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 Wes MacDonald

Wes MacDonald is a DevOps Consultant for LIKE 10 INC., a DevOps consulting firm providing premium support, guidance and services for Azure, Microsoft 365 and Azure DevOps.

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)

    Like

  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)

    Like

Leave a Reply to Aimee Cancel 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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: