Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encrypting passwords in WinForms app.config, .NET

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.

like image 902
agnieszka Avatar asked Sep 08 '09 09:09

agnieszka


People also ask

Is it safe to store passwords in config file?

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.

How do you encrypt configuration sections?

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.


1 Answers

Encrypting Passwords in a .NET app.config File

like image 53
Wael Dalloul Avatar answered Sep 28 '22 07:09

Wael Dalloul