Whirlpool
#1

I think I saw a topic with the solution to this a while back, but I can't find it. Basically I'm making a PHP UCP for my website.. and the hashes won't match, even though they are using the same salt etc. The whirlpool made with the server starts with 250 and the PHP starts with 814... Can anyone post a fix? I think it was something to do with if the string is a capital.. But I've used strtoupper to counter that problem.
Reply
#2

Whirlpool encryption is case-sensitive so "text" will have a different hash than "TeXT" and "Text", so do not alter the string in that aspect. However, PHP will return the hash in lowercase while PAWN in uppercase, so make sure you're ignoring the case when comparing both hashes.
Reply
#3

I'm seeing if the password and username they gave belongs to a valid account (therefore they loggedin) with a query (for example : "SELECT BLA FROM BLA WHERE username='myusrname' AND password='thepass')

Do you know a way I can do it through a query? Or should I just load the password from the account and then compare strings?
Reply
#4

Yes, you can do it with a query like this:
Код:
SELECT * FROM accounts WHERE username='username' AND password='thepass'
Obviously, "thepass" is the hashed text the user will input and you compare it with the hashed password stored in your database...

It will return a row if it found the account with that specified username and username (therefore, the login was successful) but if the account wasn't found, it will not return any row (meaning a failed login).
Reply
#5

lol, I meant is there A way I can toggle the case sensitivity ? I've done the query above (reason why I made this post) and the hash that the user enters is totally different from the one in the database (AKA its probably the case in php).
Reply
#6

Just use toupper at the hashed string from PHP:
Код:
toupper( hash( 'whirlpool', $string ) )
returns the upper case hash, like in SA:MP. This is the only problem your could have with the Whirlpool in PHP, I had the same problem and toupper solved.
Reply
#7

PHP код:
$password strtoupper(hash('whirlpool'$password)); 
Already have that and it's not solved my issue :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)