Php custom complex MD5 encryption function this article is to first customize the complex MD5 encryption function to encrypt the password, and then the system's md5 encryption program to encrypt, the following describes the implementation method.
Although md5 ciphertext is limited, the number of ciphertext is 6.3340286662973277706162286946812e + 49. if you don't feel this number, you can imagine that the fifth power of 0.1 billion takes tens of millions again.
I have been in touch with a lot of programs before. when I was a Cainiao hacker ......, Most of the program's encryption methods are "md5", and they are pure encryption. this is not an error because the md5 algorithm is not cracked after all, but with the collection of feature strings, it is becoming more and more dangerous to use pure md5 encryption.
Writing a program by myself is generally used to adding the feature string to MD5, and I think it is safe, but today I found that feature string 5 can actually crack this encryption method, of course, the premise is to know the feature string, although I am more complex, however, out of defense, encryption functions are still complicated.
Php custom complex MD5 encryption function code:
Function md123 ($ sstr)
{
$ Md_asc = "";
$ Mds = md5 ("qwEqw". $ sstr. "2ddsdf ");
$ Mds = md5 ("rtrTtyr". $ mds. "zcv34r ");
For ($ I = 1; $ I <strlen ($ mds); $ I ++ ){
$ Md_asc. = 168/ord (substr ($ mds, $ I, 1 ));
} // Open source code phpfensi.com
Return md5 ($ md_asc );
}
In this way, the security of the password is further improved through the string and ascii. when passing the ord, a simple 1 has been converted into a character:
1.73195876288662.94741042105261.66336633663373.1111
1111111113.23076923076923.16981132075471.731958762
88661.683.42857142857142.94710942105261.681.681.6470
5882352943.111111111111.66336633663372.94721342
105263.42857142857141.66336633663373.1698113207547
3.16981132075473.111111111111.69696969696971.681.7
1428571428573.16981132075471.71428571428573.294117
64705881.681.64705882352941.69696969696971.64705882
352946ccc2eceada95b64bc7f55c07c2a6af6
In this way, MD5 encryption is performed to ensure security.