CopyCode The Code is as follows: <? PHP
Echo substr (MD5 ("admin"), 8, 16); // 16-bit MD5 Encryption
Echo "<HR> ";
Echo MD5 ("admin"); // 32-bit MD5 Encryption
?>
The 16-bit MD5 encryption is achieved by intercepting characters using the substr function ....
I don't want to study it in depth. I need to put my mental power in other key areas ~~
Today, I made a PHP link to the MSSQL database. The fields in the table in the database are encrypted using MD5 sixteen. However, MD5 in PHP is 32 bits by default, causing LogonProgramThere is no way to use MD5 encryption to match fields in the Table. Many people may be confused about this issue when searching on the Internet. After finding a solution, it is correct and recorded.
Use the substr function to intercept:
Substr (MD5 ("admin"), 8, 16); // 16-bit MD5 Encryption
MD5 ("admin"); // 32-bit MD5 Encryption
The results of the script home test are as follows:
We compare the results of several MD5 values in ASP.
Appendix: If you encounter an MD5 encrypted file and do not know the password, replace this set of encrypted data in the database.
Admin --- 16-bit encryption --- 7a57a5a743894a0e
Admin --- 32-bit encryption --- 21232f297a57a5a743894a0e4a801fc3
Admin --- 40-bit encryption --- 7a57a5a743894a0e4a801fc343894a0e4a801fc3
Substr (MD5 ("admin"), 8, 16); // The 16-bit MD5 encryption is the 16 characters starting from 8th characters. Therefore, you do not need to consider the uniqueness issue. It is correct. Some people on the Internet say that PhP5 supportsCopy codeThe Code is as follows: Echo MD5 ("admin", true); // return 16 bits, but this is only available in PhP5.
The output result is garbled. If you have any good code, share it.