Home > Backend Development > PHP Tutorial > php custom complex MD5 encryption function_PHP tutorial

php custom complex MD5 encryption function_PHP tutorial

WBOY
Release: 2016-07-13 17:11:10
Original
981 people have browsed it

This article first encrypts the password by customizing the complex MD5 encryption function, and then encrypts it by the system's md5 encryption program. Let me introduce the implementation method below.

Although the ciphertext of md5 is limited, its number is 6.3340286662973277706162286946812e+49. If you have no idea about this number, you can imagine that 100 million raised to the fifth power and multiplied by tens of millions will be enough. . . . .

I have been exposed to many programs before (when I was a rookie hacker...), and the encryption method of most programs is "md5", and it is pure encryption. This is not wrong at first, I thought that the md5 algorithm has not been cracked after all. , but with the collection of characteristic strings, using pure md5 encryption has become increasingly dangerous.

When writing programs, I usually add a characteristic string and then MD5, thinking that it is foolproof. But today I found that cmd5 can actually crack this encryption method. Of course, the premise is to know the characteristic string. Although mine is more complicated, it doesn’t work. Due to the precautionary mentality, the encryption function is still complicated.

 代码如下 复制代码
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, password security is further improved through random strings and ascii. When passing ord, a simple 1 has been converted into the following characters:

1.73195876288662.94736842105261.66336633663373.1111

1111111113.23076923076923.16981132075471.731958762

88661.683.42857142857142.94736842105261.681.681.6470

5882352943.11111111111111.66336633663372.94736842

105263.42857142857141.66336633663373.1698113207547

3.16981132075473.11111111111111.69696969696971.681.7

1428571428573.16981132075471.71428571428573.294117

64705881.681.64705882352941.69696969696971.64705882

352946ccc2eceada95b64bc7f55c07c2a6af6

It will be safe if you perform MD5 encryption in this way. If it is still cracked, just hang yourself with noodles

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629614.htmlTechArticleThis article first customizes the complex MD5 encryption function to encrypt the password, and then uses the system's md5 encryption program To encrypt, let me introduce the implementation method. Although the md5 password...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template