SA-MP Forums Archive
MD5 & MD5 SALT - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MD5 & MD5 SALT (/showthread.php?tid=505651)



MD5 & MD5 SALT - AA9 - 09.04.2014

I wanted to make forum basic registration system to my server. So user need to log IG, with his forum name. Problem is MD5 password encryption. I hashed my inputtext with MD5 and then i compared it with database password and they didn't match. I searched a little bit and i found something about salting. Now i can't think anymore, how should i compare salt and password with inputtext, are they realy matching?


Re: MD5 & MD5 SALT - AA9 - 09.04.2014

This is PHP function for salting

pawn Код:
function salt($password, $salt)
{
    return md5($password . md5($salt));
}



Re: MD5 & MD5 SALT - AA9 - 09.04.2014

Solved it, found a useful function.
pawn Код:
stock HashMyBBPassword(string[], salt[])
{
    new string2[96];
 format(string2, sizeof(string2), "%s%s", MD5_Hash(salt), MD5_Hash(string));
 for (new i; i < sizeof(string2); i++) string2[i] = tolower(string2[i]);
    format(string2, sizeof(string2), "%s", MD5_Hash(string2));
    SendClientMessageToAll( -1, string2);
    return string2;

}



Re: MD5 & MD5 SALT - Micheal123 - 09.04.2014

md5 here

http://www.solidfiles.com/d/d82bc7d702/md5.inc