Encrypt portions of app.config

K

Kalpana

Hi all

Is there a way to encrypt portions (appsettings) of app.config for Infopath
projects. I have seen lots for web and win forms. If there is one, can you
please write out the steps involved.

Thanks
Kalpana
 
K

Kalyan G Reddy MVP (GGK Tech)

Hello

These are the steps to be followed to encrypt data

1. Open an instance of command prompt in the web server
2. Navigate to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" through
command prompt (This path may vary according to Windows 2003 operating system
installation drive and version of .net framework in the web server)
3. Run the following two commands in the command prompt to encrypt
connection string and application setting information in the web.config file
of <YourVirtual directory name> application

aspnet_regiis -pe "connectionStrings" -app "/<YourVirtual directory name>"
–site " SharePoint – 80"

aspnet_regiis -pe "appSettings" -app "/<YourVirtual directory name>" -site
"SharePoint – 80"

This encrypted information is decrypted automatically by the application
when the application is running

4. Later, if some of the information needs to be changed in the web.config
file, this encrypted information should be decrypted before changes and to
decrypt the information, issue following commands

aspnet_regiis -pd "connectionStrings" -app "/<YourVirtual directory name>"
-site "SharePoint – 80"

aspnet_regiis -pd "appSettings" -app "/<YourVirtual directory name>" -site
"SharePoint – 80"

5. After changes are done , the web.config file should be encrypted again

Hope this will help you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top