0
<appSettings>
<add key="uname" value="user001" />
<add key="pword" value="pass001" />
</appSettings>

I'm trying to encrypt the password (pword) in the web.config file. One method is by using ASPNET_REGIIS. Is there any other way so that, instead of directly typing the password on web.config file, I can encrypt it in the server side code? i.e, by writing some encryption and decryption methods. Or using DESCryptoServiceProvider class?

Ashin
  • 139
  • 3
  • 15

1 Answers1

0

You certainly can encrypt it server side using some form of symmetric encryption.

See here a good example of using string encryption/decryption using AES: https://stackoverflow.com/a/10177020/783836

Note that you would to

Community
  • 1
  • 1
user783836
  • 3,099
  • 2
  • 29
  • 34