Skip to content Skip to sidebar Skip to footer

How Can I Get A Sql Server Md5 Hash To Match A Previous Php Md5 Hash?

I have a SQL Server 2014 table filled with MD5 hashses generated by php using the php $hash = md5($password); command. Now that we are moving to a tighter security model, I would l

Solution 1:

My apologies! I was sending the value [password] to the sql hash sequence not the inputted variable @password! So I was receiving in Test and MD5 a hash of a hash, not the hash of the original password.

Interestingly enough, the fancy master.sys.fn_varbintohexsubstring(0, HASHBYTES('MD5', CONVERT(VARCHAR(32), [password])), 1, 0) is needed to remove the leading 0x to get the right match.

Post a Comment for "How Can I Get A Sql Server Md5 Hash To Match A Previous Php Md5 Hash?"