pgina / pgina

pGina: Open Source Windows Authentication

Home Page:http://pgina.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMD5 MySQL

b-gauthier opened this issue · comments

Hi all,

I would like to use passwords stored in a MySQL database hashed with the folowing function (salted md5 - php) :

public function crypt_password($cleartext_password) { $salt="$1$"; $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; for ($n=0;$n<8;$n++) { $salt.=$base64_alphabet[mt_rand(0, 63)]; } $salt.="$"; return crypt($cleartext_password, $salt); }

But, I don't really understand the meaning of the encoding process described in the pgina doc :

encoding ( hash( password + salt ) + salt )

Do I have to add a base64_encode() at the end of the previous function to get it work with pgina ?

Thanks guys !