/web/acc/manager/lib/crypt/crypt.php |
---|
3,15 → 3,15 |
{ |
$numargs=func_num_args(); |
$passwd=func_get_arg(0); |
# calcul d'un salt pour forcer le chiffrement en MD5 au lieu de blowfish par defaut dans php version mdva > 2007.1 |
# set the salt and the algorithm |
$shuf = substr(str_shuffle("abcdefghijklmnopqrstuvwxyz0123456789"),0,8); |
# hash md5 > empreinte du mot de passe sur 22 caracteres |
#$salt='$1$passwd$'; |
//$salt='$1'.'$'.$shuf.'$'; |
# hash sha-256 > empreinte du mot de passe sur 43 caracteres |
$salt='$5$passwd$'; |
$salt='$5'.'$'.$shuf.'$'; |
# hash sha-512 > empreinte du mot de passe sur 86 caracteres |
#$salt='$6$passwd$'; |
if ($numargs == 2){ |
#$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); |
} |
/web/acc/manager/lib/crypt/crypt.php.orig |
---|
0,0 → 1,14 |
<?php |
function da_encrypt() |
{ |
$numargs=func_num_args(); |
$passwd=func_get_arg(0); |
# calcul d'un salt pour forcer le chiffrement en MD5 au lieu de blowfish par defaut dans php version mdva > 2007.1 |
$salt='$1$passwd$'; |
if ($numargs == 2){ |
$salt=func_get_arg(1); |
return crypt($passwd,$salt); |
} |
return crypt($passwd,$salt); |
} |
?> |
/web/pass/crypt/crypt.php |
---|
3,9 → 3,15 |
{ |
$numargs=func_num_args(); |
$passwd=func_get_arg(0); |
# calcul d'un salt pour forcer le chiffrement en MD5 au lieu de blowfish par defaut dans php version mdva > 2007.1 |
$salt='$1$passwd$'; |
if ($numargs == 2){ |
# set the salt and the algorithm |
$shuf = substr(str_shuffle("abcdefghijklmnopqrstuvwxyz0123456789"),0,8); |
# hash md5 > empreinte du mot de passe sur 22 caracteres |
//$salt='$1'.'$'.$shuf.'$'; |
# hash sha-256 > empreinte du mot de passe sur 43 caracteres |
$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); |
} |