Php custom complex MD5 encryption function _ PHP Tutorial

Source: Internet
Author: User
Php custom complex MD5 encryption function. In this article, we will first customize the complex MD5 encryption function to encrypt the password, and then encrypt it by the system's md5 encryption program. next I will introduce the implementation method. Although the md5 password is described in this article, we will first customize the complex MD5 encryption function to encrypt the password, and then encrypt it by the system's md5 encryption program. below I will introduce the implementation method.

Although md5 ciphertext is limited, the number is 6.3340286662973277706162286946812e + 49. if you do not feel this number, you can imagine that the fifth power of 0.1 billion is about to multiply by tens of millions .....

I have been in touch with many programs before (when a Cainiao hacker was ......), 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 increasingly 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.

The code is as follows:
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 ));
}
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 to the following 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 will be performed to ensure security. if the attack is still cracked, use the noodles for hanging.

Bytes. Although the md5 password...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.