I am storing user logon encrypted passwords in a database (SQL Server). Because of an API restriction, the passwords need to be encrypted on the C# end of things, so I can’t use the database’s built-in encryption. what is the fastest/easiest way to encrypt these passwords so I can compare them to what the user would have typed in to a third-party service later?
I am new to C# and I understand that passwords should never be in plain text so that’s why I want to make sure I have the highest security. I have tried using the RSA.EncryptValue() function but I’m pretty lost as to how to use it correctly.
Any help is appreciated – thanks in advance.
-Jimmy
You don’t want to encrypt and store passwords. You want to generate a hash and store that. Then, when a user is logging in, you regenerate the hash and compare it to the one stored in the database.
The answers to this question provide examples of how one might hash a password in c# (one answer includes information on doing a “salted” hash).