Copy CodeThe code is as follows:
Echo substr (MD5 ("admin"), 8,16); 16-bit MD5 encryption
echo "";
echo MD5 ("admin"); 32-bit MD5 encryption
?>
The 16-bit MD5 encryption uses the SUBSTR function to intercept the characters to be implemented ....
Don't want to delve into it: Put your brain on the other key areas
Today made a PHP link MSSQL database, the table in the database field using MD5 16 encryption. But PHP in the default is 32-bit, resulting in the login program can not use MD5 encryption with the table field matching, in the online a search there are many people have this confusion, and later found a solution, is correct, on record down.
Use the SUBSTR function to intercept:
SUBSTR (MD5 ("admin"), 8,16); 16-bit MD5 encryption
MD5 ("admin"); 32-bit MD5 encryption
the script home test results are as follows:
We compare the results after several MD5 of ASP
Attached: If you encounter MD5 encrypted files, but do not know the password, please exchange 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 32 of the 16 characters starting with the 8th character. So you don't have to think about the uniqueness of the problem. is right in itself. Someone online says PHP5 support
Copy CodeThe code is as follows:
echo MD5 ("admin", true);//returns 16 bits, but this is only in PHP5.
The results of the test output is garbled, if you have any good code, you can share the next.
http://www.bkjia.com/PHPjc/318927.html www.bkjia.com true http://www.bkjia.com/PHPjc/318927.html techarticle Copy the code as follows: PHP echosubstr (MD5 ("admin"), 8,16),//16-bit MD5 encryption echo "HR"; ECHOMD5 ("admin");//32-bit MD5 encryption? The 16-bit MD5 encryption uses the SUBSTR function to intercept the characters to be implemented ...