Source for file crypt.php
Documentation is available at crypt.php
* Test of authentication object logic - crypt'ed passwords
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
require
'inc/bb/basicauth.php';
$methods =
array('md5', 'md5_compat', 'md5_emulated', 'des', 'sha1');
foreach ($methods as $m) {
print
"Using method $m\n";
print
"strlen=".
strlen($enc).
"\n";
// test that the md5 and md5_emulated methods do the same thing
print
"\nTest custom md5 methods\n";
$salt =
'$md5$'.
substr($salt,3);
print
$enc1 .
"\n" .
$enc2 .
"\n" .
($enc1==
$enc2 ?
"PASS: passwords match\n" :
"FAIL: no match\n");
// test that the sha1 and sha1_binary methods do the same thing
print
"\nTest custom sha1 methods\n";
$salt =
'$sha1_binary$'.
substr($salt,6);
print
$enc1 .
"\n" .
$enc2 .
"\n" .
($enc1==
$enc2 ?
"PASS: passwords match\n" :
"FAIL: no match\n");
Documentation generated on Tue, 06 Mar 2007 10:01:10 +0000 by phpDocumentor 1.3.0