Solved

encrypt connection string

Posted on 2011-09-29
4
362 Views
Last Modified: 2012-05-12
hi,

im encrypting my asp.net connection strings on my dev environment like so

var config = WebConfigurationManager.
                OpenWebConfiguration("~");

            var section =
                config.GetSection("connectionStrings")
                as ConnectionStringsSection;

                      section.SectionInformation.ProtectSection(
                    "RSAProtectedConfigurationProvider");
                     config.Save();

Open in new window


When i deploy this the encrypted web.config to Live environment do i need to export a key from my dev environment? Or should I just run the encryption routine it on live?

Also what key does "RSAProtectedConfigurationProvider" use to do the encryption and what will stop someone accessing that key when it goes live?

Thanks very much
0
Comment
Question by:MrKevorkian
  • 2
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 36815226
When i deploy this the encrypted web.config to Live environment do i need to export a key from my dev environment? Or should I just run the encryption routine it on live?
Also what key does it use to do the encryption and what is to stop someone accessing that key when it goes live?
IIRC, the encryption algorithm uses the machine key to encrypt the data. The only thing you should need to do is to run the asp helper application, aspnet_regiis.exe on the target machine to initially encrypt the sections using that machine's key. You would not deploy the key from your development server.


Also what key does it use to do the encryption and what is to stop someone accessing that key when it goes live?
As I stated, it should be the machine key that's used, so if someone has found access to that, you've probably got bigger problems going on  = )
0
 
LVL 1

Author Comment

by:MrKevorkian
ID: 36815302
Thanks thats very useful.

So "RSAProtectedConfigurationProvider" uses IIRC?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36815512
IIRC => "If I Recall Correctly"   = )
0
 
LVL 1

Author Comment

by:MrKevorkian
ID: 36815517
haha! thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question