I developed a Windows service application and in my app.config
file I need to encrypt my password and decrypt in my application.
How can I do this ?
I developed a Windows service application and in my app.config
file I need to encrypt my password and decrypt in my application.
How can I do this ?
See Encrypting Passwords in a .NET app.config file to learn how to encrypt entire config sections.
If that's too much for you, then just use any decent reversible encryption algorithm (like AES, Blowfish) in .NET and store the encrypted username/password as a string in your config and decrypt it when you load the contents from the app.config
file.
There are literally tons of samples out there, e.g. Encrypt/decrypt string in .NET right here on Stackoverflow showing how to use the Rijndael (a.k.a. AES) algorithm for your needs.