1

I have an encrypted password in a connection string, contained in a web.config file. I do not know what the password is, and thus cannot connect to my database.

I ran aspnet_regiis.exe -pdf against the web.config and received the following:

Decrypting configuration section...
Succeeded!

I guess I had assumed that the password would be displayed on the screen, or something close to that? Then I thought the program might create a log file with the information in it? Couldn't find one.

I know I am missing something fundamental, I just don't know what it is.

Ondrej Tucny
  • 27,626
  • 6
  • 70
  • 90
Brian Ashcraft
  • 117
  • 1
  • 7

2 Answers2

0

Run below command

aspnet_regiis.exe –pdf “connectionStrings” C:\inetpub\wwwroot\MyApplication

C:\inetpub\wwwroot\MyApplication needs to be the path where your web.config file is. Once you finish executing above command check your web.config file. If it worked OK you will have decrepted connection string section.

Hakunamatata
  • 1,275
  • 13
  • 18
0

You cannot decrpty the encrypted password. The whole point of encrypting the password is so that no one is able to decrpty and find what the password is unless you know the key.

When you encrypt the connection string, the key is automatically created and stored in the machine where the encryption was done.

So, if you copy the web.config file to some other machine and do the decryption using:

aspnet_regiis.exe –pdf “connectionStrings” YourPathToWebConfigFile

This won't work.

And to answer your question, if the encryption and decryption was done on the same machine, then your web config file will change automatically with the plain text (decrypted data) for connection string , not that the password would be displayed on the screen.

ANewGuyInTown
  • 5,957
  • 5
  • 33
  • 45