index e80e566514f365fde1aabf880fd75519af6e0bc6..34cb303fe8fe75dd7a208b710ce12ec568113b9b 100644 (file)
if (function_exists("sha1")) {
$salt= substr(pack("h*", md5(mt_rand())), 0, 8);
$salt= substr(pack("H*", sha1($salt.$pwd)), 0, 4);
if (function_exists("sha1")) {
$salt= substr(pack("h*", md5(mt_rand())), 0, 8);
$salt= substr(pack("H*", sha1($salt.$pwd)), 0, 4);
- $pwd= "{ssha}".base64_encode(pack("H*", sha1($pwd.$salt)).$salt);
+ $pwd= "{SSHA}".base64_encode(pack("H*", sha1($pwd.$salt)).$salt);
return $pwd;
} elseif(function_exists("mhash")) {
$salt=mhash_keygen_s2k(MHASH_SHA1,$pwd, substr(pack("h*",md5(mt_rand())),0,8),4);
return $pwd;
} elseif(function_exists("mhash")) {
$salt=mhash_keygen_s2k(MHASH_SHA1,$pwd, substr(pack("h*",md5(mt_rand())),0,8),4);
- $pwd= "{ssha}".base64_encode(mhash(MHASH_SHA1, $pwd.$salt).$salt);
+ $pwd= "{SSHA}".base64_encode(mhash(MHASH_SHA1, $pwd.$salt).$salt);
} else {
print_red(_("Can't use ssha for encryption. (Missing function mhash / sha1)"));
return(false);
}
return $pwd;
}
} else {
print_red(_("Can't use ssha for encryption. (Missing function mhash / sha1)"));
return(false);
}
return $pwd;
}
+
+
+ function get_hash_name()
+ {
+ return "ssha";
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: