问题描述在:
http://forum.byr.edu.cn/wForum/disparticle.php?boardName=Security&ID=30012&pos=3
验证代码如下:
<?php $key_1 = "12345678"; $key_2 = "13245768"; $plain = "BookMoth~"; $encrpted = mcrypt_ecb(MCRYPT_DES,$key_1,$plain,MCRYPT_ENCRYPT); if($plain == trim(mcrypt_ecb(MCRYPT_DES,$key_1,$encrpted,MCRYPT_DECRYPT))){ echo "key1 works~"; } if($plain == trim(mcrypt_ecb(MCRYPT_DES,$key_2,$encrpted,MCRYPT_DECRYPT))){ echo "key_1 == key2"; } echo mcrypt_ecb(MCRYPT_DES,$key_1,$plain,MCRYPT_ENCRYPT)==mcrypt_ecb(MCRYPT_DES,$key_2,$plain,MCRYPT_ENCRYPT); ?>
有空要好好翻翻密码学的书,当初密码真是学的很烂……