Encrypting SOME application settings

B

BillAtWork

Hi,
I'm looking for a tidy approach to this. I have a number of asp.net
application settings stored in web.config and I'd like to encrypt SOME of
them but not all of them!

e.g.
<appSettings>
<add key="ANiceMessage" value="Hello Everyone"/>
<add key="AnotherMessage" value="Hi Again"/>
<add key="databaseconnectionstring" value="dontwantyoutoreadthis"/>
</appSettings>

I'd like to be able to encrypt just the database connection and yet leave
the other keys accessible so that they can be changed if required.

Is there a way to do that or do I have to encrypt the whole section to take
advantage of the automatic decryption provided by asp.net? Is there a tidy
alternative i.e. so that I can access all settings via
ConfigurationSettings.AppSettings["key"]?

Thanks!
 
G

Guest

Hi,
I'm looking for a tidy approach to this. I have a number of asp.net
application settings stored in web.config and I'd like to encrypt SOME of
them but not all of them!

e.g.
  <appSettings>
    <add key="ANiceMessage" value="Hello Everyone"/>
    <add key="AnotherMessage" value="Hi Again"/>
    <add key="databaseconnectionstring" value="dontwantyoutoreadthis"/>
  </appSettings>

I'd like to be able to encrypt just the database connection and yet leave
the other keys accessible so that they can be changed if required.

Is there a way to do that or do I have to encrypt the whole section to take
advantage of the automatic decryption provided by asp.net? Is there a tidy
alternative i.e. so that I can access all settings via
ConfigurationSettings.AppSettings["key"]?

Thanks!

Put the secret key to the special section (out of appSettings) like it
is explain here
http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx

then you could simply use aspnet_regiis
 
B

BillAtWork

Thank you. Looks great.

Anon User said:
Hi,
I'm looking for a tidy approach to this. I have a number of asp.net
application settings stored in web.config and I'd like to encrypt SOME of
them but not all of them!

e.g.
<appSettings>
<add key="ANiceMessage" value="Hello Everyone"/>
<add key="AnotherMessage" value="Hi Again"/>
<add key="databaseconnectionstring" value="dontwantyoutoreadthis"/>
</appSettings>

I'd like to be able to encrypt just the database connection and yet leave
the other keys accessible so that they can be changed if required.

Is there a way to do that or do I have to encrypt the whole section to take
advantage of the automatic decryption provided by asp.net? Is there a tidy
alternative i.e. so that I can access all settings via
ConfigurationSettings.AppSettings["key"]?

Thanks!

Put the secret key to the special section (out of appSettings) like it
is explain here
http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx

then you could simply use aspnet_regiis
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top