Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

HashPassword with MD2 to match SQL HASHBYTES

$
0
0

I have a database that uses MD2 password hashing via the SQL Server HASHBYTES function. I don't see MD2 in the System.Security.Cryptography library, nor a way for the System.Web.Helpers.Crypto library to help me. Should I just be changing my user selection query to select where password = HASHBYTES('md2', password)? If so, what do I do with my custom storage provider's passwordhasher? It seems I have to implement a password hasher, so would I just return PasswordVerificationResult.Success every time? Also, how can I accomplish this while still using Entity Framework? Perhaps with a stored procedure or something?

Or... should I instead be somehow writing C# code to create the same hash so I can select it out of the database and compare? I see there is a CryptoConfig.AddAlgorithm method, so maybe I can find the md2 algorithim code to add? I wouldn't have any idea where to start if I went down this road.

I'm using Asp.net Ideneity 2.2.1 with my own custom (existing) database that cannot be changed.


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>