PHP bug 66564原文 https://bugs.php.net/bug.php?id=66564
本地测试了下此Bug
$long = str_repeat('a', 72);
var_dump(crypt($long . "a", '$2y$04$saltysaltysaltysaltytt'));
var_dump(crypt($long . "b", '$2y$04$saltysaltysaltysaltytt'));
var_dump(crypt($long . "c", '$2y$04$saltysaltysaltysaltytt'));
$long = str_repeat('我', 24);
var_dump(crypt($long . "a", '$2y$04$saltysaltysaltysaltytt'));
var_dump(crypt($long . "b", '$2y$04$saltysaltysaltysaltytt'));
var_dump(crypt($long . "c", '$2y$04$saltysaltysaltysaltytt'));
结果如下
string '$2y$04$saltysaltysaltysaltyte9usMwh4/IIx0al18sl5oEFVM2Z/XJ7q' (length=60)
string '$2y$04$saltysaltysaltysaltyte9usMwh4/IIx0al18sl5oEFVM2Z/XJ7q' (length=60)
string '$2y$04$saltysaltysaltysaltyte9usMwh4/IIx0al18sl5oEFVM2Z/XJ7q' (length=60)
string '$2y$04$saltysaltysaltysaltyte2TUsnZ4FK4xRcHhRZV8xAYwjrjTPFye' (length=60)
string '$2y$04$saltysaltysaltysaltyte2TUsnZ4FK4xRcHhRZV8xAYwjrjTPFye' (length=60)
string '$2y$04$saltysaltysaltysaltyte2TUsnZ4FK4xRcHhRZV8xAYwjrjTPFye' (length=60)
所有网站是用crypt做加密的需要注意
最长 英文字符是71个、中文字符是23个 否则加密数据会有错误虽然被加密了但是不是正确的值