SA-MP Forums Archive
Whirlpool - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whirlpool (/showthread.php?tid=442256)



Whirlpool - thefatshizms - 06.06.2013

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.


Respuesta: Whirlpool - admantis - 06.06.2013

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.


Re: Whirlpool - thefatshizms - 06.06.2013

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?


Respuesta: Whirlpool - admantis - 06.06.2013

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).


Re: Whirlpool - thefatshizms - 06.06.2013

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).


Re: Whirlpool - IstuntmanI - 06.06.2013

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.


Re: Whirlpool - thefatshizms - 06.06.2013

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