Comparing passwords (WP)
#1

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
Reply
#2

is your login/register system, made with Dini/ZCMD/ or Y_INI ?
Reply
#3

print both of them and see if they're same.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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
Reply
#7

Or too small.
It should be 129 of size.
Check your Loading code or post it here.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)