Whirpool Hashing
#1

Hey,
I have got a problem with Whirpool.
It works great when I register, but it would not let me login.
These are three versions I tried:
___________________________________________
pawn Код:
/*THIS ONE REDIRECTS ME TO PASSWORD DOES NOT MATCH ( }else{ )*/
new buf[129];
WP_Hash(buf, sizeof (buf), inputtext);
if(strcmp(pass, buf, true))
{
/*CORRECT PASSWORD*/
}
pawn Код:
/*THIS ONE REDIRECTS ME TO PASSWORD DOES NOT MATCH TOO ( }else{ )*/
new buf[129];
WP_Hash(buf, sizeof (buf), inputtext);
if(strcmp(buf, pass, true))
{
/*CORRECT PASSWORD*/
}
pawn Код:
/*HERE THE DIALOG JUST DISAPPEARS (No action taken)*/
new buf[129];
WP_Hash(buf, sizeof (buf), inputtext);
if(!strcmp(buf, pass, true))
{
/*CORRECT PASSWORD*/
}
Any ideas?
- Thanks

EDIT: pass and MySQL password field are defined as 128.
Reply
#2

What does "pass" hold?, obviously a password but how do you assign it?
Reply
#3

It should be the last one. maybe try just removing the true part.
pawn Код:
if ( !strcmp ( buf, pass ) )
Reply
#4

Yeah, I forgot to add.
The original post is edited now.
The Database and "pass" are both 128.
Reply
#5

I don't mean the size, i mean what string do they hold? how do you put the string into "pass"?
Is pass an empty array?, is what i mean.
File system maybe?
buff = inputtext
pass = ?
Reply
#6

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I don't mean the size, i mean what string do they hold? how do you put the string into "pass"?
Is pass an empty array?, is what i mean.
File system maybe?
It writes everything correctly into the Database:

FD9D94340DBD72C11B37EBB0D2A19B4D05E00FD78E4E2CE892 3B9EA3A54E900DF181CFB112A8A73228D1F3551680E2AD9701 A4FCFB248FA7FA77B95180628BB2
Reply
#7

Do you actually put that string into pass?
Reply
#8

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Do you actually put that string into pass?
This string is saved into the Database after being hash by Whirpool.
What I trying to do is - unhash this string correctly to be able to login.

EDIT: And yes, it does SELECT * FROM to get "pass"
Reply
#9

This is how I get "pass"
pawn Код:
format(MySQL, sizeof(MySQL), "SELECT * FROM `Accounts` WHERE `User` = '%s' AND `Password` = '%s'", dUser, pass);
Reply
#10

Quote:
Originally Posted by LightFight™
Посмотреть сообщение
This is how I get "pass"
pawn Код:
format(MySQL, sizeof(MySQL), "SELECT * FROM `Accounts` WHERE `User` = '%s' AND `Password` = '%s'", dUser, pass);
You could do:
pawn Код:
format(MySQL, sizeof(MySQL), "SELECT COUNT(*) FROM `Accounts` WHERE `User` = '%s' AND `Password` = '%s'", dUser, pass);
Then simply check if count equals 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)