首页 > 代码库 > PHP处理0e开头md5哈希字符串缺陷/bug

PHP处理0e开头md5哈希字符串缺陷/bug

PHP在处理哈希字符串时,会利用”!=”或”==”来对哈希值进行比较,它把每一个以”0E”开头的哈希值都解释为0,所以如果两个不同的密码经过哈希以后,其哈希值都是以”0E”开头的,那么PHP将会认为他们相同,都是0。关于PHP hash比较缺陷详细介绍:http://www.freebuf.com/news/67007.html 0x01 md5(str)QNKCDZO0e830400451993494058024219903391 s878926199a0e545993274517709034328855841020 s155964671a0e342768416822451524974117254469 s214587387a0e848240448830537924465865611904 s214587387a0e848240448830537924465865611904 s878926199a0e545993274517709034328855841020 s1091221200a0e940624217856561557816327384675 s1885207154a0e509367213418206700842008763514 s1502113478a0e861580163291561247404381396064 s1885207154a0e509367213418206700842008763514 s1836677006a0e481036490867661113260034900752 s155964671a0e342768416822451524974117254469 s1184209335a0e072485820392773389523109082030 s1665632922a0e731198061491163073197128363787 s1502113478a0e861580163291561247404381396064 s1836677006a0e481036490867661113260034900752 s1091221200a0e940624217856561557816327384675 s155964671a0e342768416822451524974117254469 s1502113478a0e861580163291561247404381396064 s155964671a0e342768416822451524974117254469 s1665632922a0e731198061491163073197128363787 s155964671a0e342768416822451524974117254469 s1091221200a0e940624217856561557816327384675 s1836677006a0e481036490867661113260034900752 s1885207154a0e509367213418206700842008763514 s532378020a0e220463095855511507588041205815 s878926199a0e545993274517709034328855841020 s1091221200a0e940624217856561557816327384675 s214587387a0e848240448830537924465865611904 s1502113478a0e861580163291561247404381396064 s1091221200a0e940624217856561557816327384675 s1665632922a0e731198061491163073197128363787 s1885207154a0e509367213418206700842008763514 s1836677006a0e481036490867661113260034900752 s1665632922a0e731198061491163073197128363787 s878926199a0e5459932745177090343288558410200x02 md5(md5()) 0x03 md5(md5(str)."SALT")20e774261293712168181959463563504

 

PHP处理0e开头md5哈希字符串缺陷/bug