Solved

encrypt connection string

Posted on 2011-09-29
4
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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