简体   繁体   中英

c# encoding to PHP encoding

I have an ASP project in which some encoding algorithm is used to save the password. I have to convert c# code to PHP code to compare the password with my table value in SQL database.

Code used in c# for encoding is

MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider();
Byte[] hashedDataBytes;
UTF8Encoding encoder = new UTF8Encoding();
hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(password));

Now while registration, I entered the password '123456', and when I checked table Customers , password saved is 0xE10ADC3949BA59ABBE56E057F20F883E00000000000000000000000000000000000000000000000000000000000000000000

and column structure in the table is Password (binary(50),null).

Can any one please tell me what code should I use in PHP to compare '123456' with 0xE10ADC3949BA59ABBE56E057F20F883E00000000000000000000000000000000000000000000000000000000000000000000

您必须在类MD5CryptoServiceProvider中检查方法ComputeHash并在PHP中编写类似的类/方法。有了那段代码,没有人可以帮助您!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM