How to generate a hash for the user password with ASP.NET MVC and .NET 4.5

1

I'm implementing a user authentication / registration feature with ASP.NET MVC 4.5, but I can not find a more correct way of working with passwords in the database, I do not want to simply generate an MD5 and write to the database .

Is there no default ASP.NET class that allows me to generate a hash or check a password with an existing hash? (Generate / Check), as it exists in PHP frameworks, for example.

    
asked by anonymous 26.02.2016 / 21:47

1 answer

1

There are several. A NuGet search on BCrypt brings a variety of them .

The ASP.NET Identity Algorithm for Passwords is here .

You can still use the algorithm of your choice. Here's an example with SHA1 .

Choosing what to use depends on your need. If it is reversible, whether it is fast, whether it is too difficult to break, and so on.

The namespace System.Security.Cryptography also has many options that you can use.

    
26.02.2016 / 22:37