Password hash question
#1

Hi guys

I use now udb_hash function for password security
Код:
stock udb_hash(buf[]) //HASH PASS
{
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Is there any way to convert all this passwords to SHA256_PassHash ( https://sampwiki.blast.hk/wiki/SHA256_PassHash ) .Because i want to use

(I use MySQL)
Reply
#2

Require the user to input their password again, udb_hash it and compare it with old pass, then if it matches, hash the password with SHA-256 and store it. Hashes are always 1-way and cannot be reversed.
Reply
#3

SHA256_PassHash <-- this is a function which is added in SA:MP 0.3.7 R1 (located in a_samp.inc)
so u can use SHA256_PassHash directly instead of udb_hash
Reply
#4

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
Require the user to input their password again, udb_hash it and compare it with old pass, then if it matches, hash the password with SHA-256 and store it. Hashes are always 1-way and cannot be reversed.
Thank you for help.I'm aslo think about it but I hoped there have way maybe )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)