I want to store a password in a config file but i would like it to be encrypted so that in the app it can be read, decrypted and used. What's the best way to encrypt a password like this?
Edit: I want to encrypt only password, not whole config, or whole section.
You can keep the passwords in the file, but store the encrypted version of the password. Even if you were to store the passwords somewhere else instead of a config file, they should be encrypted.
Encrypting a Web Configuration Section To encrypt configuration file contents, use the Aspnet_regiis.exe tool with the –pe option and the name of the configuration element to be encrypted. Use the –app option to identify the application for which the Web.
Encrypting Passwords in a .NET app.config File
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With