Rev 1467 | Blame | Compare with Previous | Last modification | View Log
<?phpfunction da_encrypt(){$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//$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.'$';return crypt($passwd,$salt);}?>