Comparing passwords (WP) -
Wesley221 - 24.08.2011
Hey guys,
Im using WP as my password encrypter, and im having problems with logging in.
Im comparing the variable which holds the password with the hashed inputtext. Ive done it like this before and that worked. But now it stopped working. What ever i type (even the right password), it says wrong password.
What can the problem be?
pawn Код:
new buffer[130];
WP_Hash(buffer, sizeof buffer, inputtext);
if(!strcmp(PlayerInfo[playerid][pPass], buffer, true)) // the true has nothing to do with the problem. its just for the "ignore case (A.K.A capslock)"
{
}
Note: PlayerInfo[playerid][pPass] does contain the password!
~Wesley
Re: Comparing passwords (WP) -
=WoR=G4M3Ov3r - 24.08.2011
is your login/register system, made with Dini/ZCMD/ or Y_INI ?
Re: Comparing passwords (WP) -
=WoR=Varth - 24.08.2011
print both of them and see if they're same.
Re: Comparing passwords (WP) -
Wesley221 - 24.08.2011
Quote:
Originally Posted by G4M3Ov3r
is your login/register system, made with Dini/ZCMD/ or Y_INI ?
|
y_ini, ycmd, WP
Quote:
Originally Posted by varthshenon
print both of them and see if they're same.
|
Код:
PlayerInfo: 246831CF3AF7BBCC90DF6EB37CF791AD3018F6DADD6F8C10B1462632A81A904A08D71865FBCA16D2F672D631F2EE1505121F3D42FE80DE28F07415AFDA961ED
Inputtext: 246831CF3AF7BBCC90DF6EB37CF791AD3018F6DADD6F8C10B1462632A81A904A08D71865FBCA16D2F672D631F2EE1505121F3D42FE80DE28F07415AFDA961ED2
Just the 2 at the end of inputtext is different. Im sure i typed both the passwords the same way.
Re: Comparing passwords (WP) -
iggy1 - 24.08.2011
Is your array the same size as the one you use to save the password? Both should be the same size, it seems one of your arrays is a cell too big.
Re: Comparing passwords (WP) -
Wesley221 - 24.08.2011
All the sizes are 130. I just double checked it. In the enum its [130], when you register the buffer is [130], when logging in the buffer is [130], when loading the password (using INI_String) is 130
Re: Comparing passwords (WP) -
=WoR=Varth - 24.08.2011
Or too small.
It should be 129 of size.
Check your Loading code or post it here.
Re: Comparing passwords (WP) -
iggy1 - 24.08.2011
Quote:
Originally Posted by varthshenon
Or too small.
It should be 129 of size.
Check your Loading code or post it here.
|
Ermm correct me if im wrong but if one is too small the the other one is too big. Both should be the same size no need to post code.
Re: Comparing passwords (WP) -
=WoR=Varth - 24.08.2011
Quote:
Originally Posted by iggy1
Ermm correct me if im wrong but if one is too small the the other one is too big. Both should be the same size no need to post code.
|
But WP hash the string to 128 character. If you want to decrease the length, it's up to you.
Re: Comparing passwords (WP) -
Wesley221 - 24.08.2011
Quote:
Originally Posted by varthshenon
But WP hash the string to 128 character. If you want to decrease the length, it's up to you.
|
WP hash needs 129 characters atleast. I changed every variable to 130, just to make sure. But none of the variables have a different size. Theyre all 130