[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

Encrypt connectionString in web.config

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
calypsoworld
Asked:
calypsoworld
3 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
Yes. No. Yes. :)
0
 
DaveKeyesCommented:
Also, the correct parameter to encrypt is -pef, the -pdf will decrypt previously encrypted connection strings, allowing you to edit them.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
burakiewiczCommented:
Im not it will work if you encrypt on one machine and publish it out to a different machine
0
 
calypsoworldAuthor Commented:
> 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
 
burakiewiczCommented:
you can decrypt the config push it to the computer that has iis and then encrypt/decrypt it on that machine
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now