Solved

Encrypt connectionString in web.config

Posted on 2010-08-23
6
593 Views
Last Modified: 2012-05-17
Hi!

I want to encrypt the connectionString settings in web.config.

I read that I'm able to use:

aspnet_regiis.exe -pdf “connectionStrings” C:\Projects\DemoApplication

Open in new window


But I have some questions:

My website is in my file system now, but I'll publish it later. It's ok to encrypt this way (above)?

My website works with typed DataSet to access SQL Server. Encrypting the connectionString will change any thing?

When I need to use the connectionString, may I use just:

string conn = ConfigurationManager.ConnectionStrings["SQL"].ConnectionString;

Open in new window


to get the connectionString? (The ASP.net will decrypt it automatically, right?)

Thanks in advance!
0
Comment
Question by:calypsoworld
[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
6 Comments
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 166 total points
ID: 33505800
Yes. No. Yes. :)
0
 
LVL 5

Accepted Solution

by:
greatsubash earned 167 total points
ID: 33508231
0
 
LVL 3

Expert Comment

by:DaveKeyes
ID: 33508888
Also, the correct parameter to encrypt is -pef, the -pdf will decrypt previously encrypted connection strings, allowing you to edit them.
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 16

Expert Comment

by:burakiewicz
ID: 33515139
Im not it will work if you encrypt on one machine and publish it out to a different machine
0
 

Author Comment

by:calypsoworld
ID: 33543567
> burakiewicz
I'm developing in my computer to publish to an IIS located on another computer.

If I can't decrypt in these conditions, how can I do that?

Thanks!

0
 
LVL 16

Assisted Solution

by:burakiewicz
burakiewicz earned 167 total points
ID: 33558609
you can decrypt the config push it to the computer that has iis and then encrypt/decrypt it on that machine
0

Featured Post

Technology Partners: 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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

718 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