Copy Code code as follows:
<?php
Echo substr (MD5 ("admin"), 8,16); 16-bit MD5 encryption
echo "echo MD5 ("admin"); 32-bit MD5 encryption
?>
16-bit MD5 encryption uses the SUBSTR function to intercept the character to achieve ....
Do not want to delve into: to put the brain to other key places ~ ~
Today I did a PHP link MSSQL database, the table in the database using MD5 16 encryption. However, PHP MD5 default is 32-bit, resulting in the login program can not use MD5 encryption and table field matching, a search on the internet there are many people have this confusion, and then find a solution, is correct, on record.
Using the SUBSTR function to intercept:
SUBSTR (MD5 ("admin"), 8,16); 16-bit MD5 encryption
MD5 ("admin"); 32-bit MD5 encryption
after the cloud-dwelling community test results are as follows:
We compare the results after several MD5 of ASP
Attachment: If you encounter a MD5 encrypted file, but do not know the password, please change 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); 16-bit MD5 encryption is exactly the 32 above 16 characters that begin with the 8th character. So we don't have to consider the uniqueness of the problem. is right in itself. Someone on the internet says PHP5 support
Copy Code code as follows:
echo MD5 ("admin", true);/return 16 digits, but this is only in PHP5.
The results of the test output is garbled, if you have any good code, you can share under.