[Tutorial] Dealing With Passwords: Hashing and Salting
#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


Messages In This Thread
Dealing With Passwords: Hashing and Salting - by Johnson_boy - 19.02.2013, 20:13
Re: Dealing With Passwords: Hashing and Salting - by Goldino - 19.02.2013, 20:15
Re: Dealing With Passwords: Hashing and Salting - by Bicentric - 19.02.2013, 21:44
Re: Dealing With Passwords: Hashing and Salting - by ReneG - 19.02.2013, 22:02
Re: Dealing With Passwords: Hashing and Salting - by Bicentric - 19.02.2013, 22:36
Re: Dealing With Passwords: Hashing and Salting - by thefatshizms - 20.02.2013, 02:11

Forum Jump:


Users browsing this thread: 5 Guest(s)