無論使用的phpass測試程序http://www.openwall.com/phpass/phpass-0.3.tar.gz或Python-phpass,並使用C * |?Y [J「KQ」%GF爲明文密碼,並作爲哈希$ P $ 9kS6tD8tVxajypvJ5837.bt2emepD8/ ,這樣做的:phpass通過身份驗證從phpBB3的某些密碼失敗?
<?php
#
# This is a test program for the portable PHP password hashing framework.
#
# Written by Solar Designer and placed in the public domain.
# See PasswordHash.php for more information.
#
require 'PasswordHash.php';
header('Content-type: text/plain');
$t_hasher = new PasswordHash(8, FALSE);
$correct2 = 'C?*|Y[j"KQ\'%gf';
$hash2 = '$P$9kS6tD8tVxajypvJ5837.bt2emepD8/';
print 'Hash: [' . $hash2 . "]\n";
print 'correct: [' . $correct2 . "]\n";
$check = $t_hasher->CheckPassword($correct2, $hash2);
if ($check)
{
print "Check IF THIS WORKScorrect: '" . $check . "' (should be '1')\n";
}
else
{
print "IT FAILED!!!!!!!!\n\n\n";
}
?>
哈希是從。中文(3.0.10),當我提供該密碼。中文,它確實工作正確
。中文是應該使用phpass本身。做$ H $而不是$ P $。
在phpBB3的數據庫條目在這個例子中是:
qlc4pi000000 「; 0;」 127.0.0.1 「; 1351902499;」 testpass 「;」 testpass 「;」 $ H $ 9kS6tD8tVxajypvJ5837.bt2emepD8 /「; 1351902499; 0; 「[email protected]」; 266402289712; 「 ''」; 1351902544; 1351902499; 0; 「 ''」; 「 ''」; 0; 0; 0; 0; 0; 0; 0 ;「en」; 0.00; 0;「DM d,Y g:ia」; 2; 0;「'」「; 0; 0; 0; 0; -3; 0; 0;」t「;」d「 ; 0; 「T」, 「A」; 0; 1; 0; 1; 1; 1; 1; 230271; 「 ''」; 0; 0; 0; 「 ''」; 「 ''」;「」 ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」' ' 「;」 ' 「;」 bf4ae169a5a21313 「; 1; 0;在phpBB3的使用0
的明文口令可以是[C * | Y [J」 KQ' %GF]和散列(換算從phpBB3格式是[$ P $ 9kS6tD8tVxajypvJ5837.bt2em epD8 /](兩個密碼&散列之間的[])
任何人都可以闡明發生了什麼,以及爲什麼這不適用於phpass? 這是在論壇是在同一臺機器上,並再次,它在phpBB3論壇上工作,所以我可以登錄罰款。它只是我直接訪問phpBB3數據庫時無法使用phpass進行身份驗證。它在其他帳戶上工作,但它只是某些帳戶失敗。