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