[Tutorial] Dealing With Passwords: Hashing and Salting
#1

Outdated, and thus removed.
Reply
#2

Nice tutorial Johnson from Lsrcr.

One question, what's Energ's samp forums name?

+REP
Reply
#3

Dammit you beat me to making this thread!

But I was never going to go over password salting, as I didn't know much about it. But now I do, and I have implemented it on my server.

+Rep to you man! :P
Reply
#4

This gamemode shows how password salting is implemented in MySQL with whirlpool in case anyone is interested.

Nice tutorial btw.
Reply
#5

Btw, I had some problems with that 'randomString' function, I have used that exact one in the past, but I think it has generated some characters what cannot be handled by the MySQL charset I am using, but as usual I am probably doing something dumb. Therefore I made my own random string generation, and created a random charset for it.

pawn Код:
new randomCharset[62][] =
{
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
    "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
};
And I just use a 'for' loop with 'strcat' and 'random' to generate the salt.

pawn Код:
for(new index; index <= sizeof(AddedSalt); ++index)
{
    strcat(AddedSalt, randomCharset[random(sizeof(randomCharset))]);
}
This is here for anyone else who encounters this problem, but again, it's probably just me.
Reply
#6

Nice tutorial, this is how I do mine:

pawn Код:
New salt[100], salts[2][50];
Format(salt, 100, "my salt");
Strmid(salts[0], salt, 0, 50);
Strmid(salts[1], salt, 50, 100);
New hashedPass[300]:
Format(hashedPass, 300, "%s%s%s", salts[0], password, salts[1]);
WP_Hash(hashedPass, 300, hashedPass);
Wrote this off memory as I'm on the phone atm. I also use this method in my php scripts
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)