Search code examples
c#mysqlasp.netpassword-encryptionsalt-cryptography

How to save passwords in MySQL database using Asp.Net in C#


What method is best suitable theses days for saving salted/hashed passwords in a database? I am thinking about BCrypt or SHA51 or PBKDF2, which one is best suited?

And someone please tell me how to implement them in Mysql database using Asp.net in C#.


Solution

  • How to save passwords in a database?

    If you have to ask, you definitely don't want to implement this yourself.

    How to implement [this] using ASP.NET

    You're lucky, they already did that for you. It's called ASP.NET Identity and is usable with about any ORM and RDBMS you can think of.

    Again, you do not want to deal with the saving of passwords yourself.