0
votes

Please share your thoughts if there is any way to encrypt app.config section with out changing code? I know that we can use aspnet_regiis.exe to encrypt the web.config file.

I came across some blogs to rename app.config to web.config and run aspnet_regiis -pef command. I am able to create an encrypted version of app.config file but application failed to read the keys from encrypted app.config. so this approach didnt work for me.

Many thanks

1
the app.config file is for a class library project? How does that work?BrokenGlass
We have a class library for data accessing and app.config with connection string and stored procedure names. Class library is being referenced in the webapplication. App.config is being copied in to the web application bin folder as assemblyname.dll.config!swork

1 Answers

2
votes

What about this way? Are you able to do that?

  1. Encrypt your connection strings and stored procedure names in app.config. (Use like tripleDes)

  2. Store your encrypted values in app.config.(like: ConnectionString="asdasfasfasfdsdgsdfa")

  3. After reading value from app.config, decrypt it with your service and use.

by the way I found my old answer about ready to use Crypto Class :)

.NET: what are my options for decrypting a password in my project .setting file