Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1467 → Rev 1468

/web/pass/crypt/crypt.php
3,6 → 3,10
{
$numargs=func_num_args();
$passwd=func_get_arg(0);
if ($numargs == 2){ //only to test or change password (keep the old algorythm and salt)
$salt=func_get_arg(1);
return crypt($passwd,$salt);
}
# set the salt and the algorithm
$shuf = substr(str_shuffle("abcdefghijklmnopqrstuvwxyz0123456789"),0,8);
# hash md5 > empreinte du mot de passe sur 22 caracteres
11,10 → 15,6
$salt='$5'.'$'.$shuf.'$';
# hash sha-512 > empreinte du mot de passe sur 86 caracteres
#$salt='$6'.'$'.$shuf.'$';
if ($numargs == 2){ //only to test and change password (keep the old algorythm and salt)
$salt=func_get_arg(1);
return crypt($passwd,$salt);
}
return crypt($passwd,$salt);
}
?>