Encrypt / Decrypt SMTP Password in Client / Server Application

I have a client application that needs to store the username / password for an SMTP server. This data will go into SQL Server 2005 and will be used by my server application. The server application will use the System.Net.Mail namespace to send email messages using the provided credentials (and from that user's email address). How can I encrypt / decrypt a password easily / securely so that I don't have clear text passwords flying through the wire? Please note that client and server applications are NOT guaranteed to reside on the same computer.

0


source to share


1 answer


.NET has a whole space for encryption. - System.Security.Cryptography ( example ). This way you can encrypt / decrypt data per client.



Now how to save the encryption key. This can be stored in an encrypted app.config as described here . Note that if the user has admin access to the machine, they can decrypt the keys stored in your app.config.

+1


source







All Articles