SA-MP Forums Archive
Getting Whirlpool hashes in PHP - 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: Getting Whirlpool hashes in PHP (/showthread.php?tid=654028)



Getting Whirlpool hashes in PHP - SeanDenZYR - 19.05.2018

i'm currently using RPUCP by SecretBoss, but i have a problem, i know that this has been asked alot of times but i couldn't find answers in the threads i found over ******.

How do i get passwords via mysql hashed by whirlpool in php?


Re: Getting Whirlpool hashes in PHP - kovac - 19.05.2018

Код:
hash("whirlpool", $string);



Re: Getting Whirlpool hashes in PHP - SeanDenZYR - 19.05.2018

i mean how to unhash?


Re: Getting Whirlpool hashes in PHP - DarkSkull - 19.05.2018

Quote:
Originally Posted by SeanDenZYR
Посмотреть сообщение
i mean how to unhash?
The main point of hashing password is not to be able to unhash it


Re: Getting Whirlpool hashes in PHP - CodeStyle175 - 19.05.2018

SeanDenZYR you already asked that question, when you got somebodys gamemode with database there isnt no need for you to see others passwords.
when you want to check if players enterd password matches with hashed password in database, you just hash player entered password and compare hashes.


Re: Getting Whirlpool hashes in PHP - SeanDenZYR - 21.05.2018

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
SeanDenZYR you already asked that question, when you got somebodys gamemode with database there isnt no need for you to see others passwords.
when you want to check if players enterd password matches with hashed password in database, you just hash player entered password and compare hashes.
Oh so the whirlpool in SAMP and PHP are the same? ok i get it, thansk!


Re: Getting Whirlpool hashes in PHP - Kraeror - 21.05.2018

Today I did it, I had the same question, so I found it! Just use Whirlpool and hash password.
Something like this:

At the top of your gamemode:
PHP код:
native WP_Hash(buffer[], len, const str[]); 
To your OnPlayerDialog (if your login/register (It's the same in the both- login and register) system is using that else just replace inputtext with the variable you want):
PHP код:
new HashedPassword[129];
WP_Hash(HashedPasswordsizeof(HashedPassword), inputtext); 
And you have to use the same hashing method in PHP!

Like this:
PHP код:
$ThePassword strtoupper(hash("whirlpool"$_POST['Password'])); 
You have to download Whirlpool plugin firstly!


Re: Getting Whirlpool hashes in PHP - SeanDenZYR - 21.05.2018

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
SeanDenZYR you already asked that question, when you got somebodys gamemode with database there isnt no need for you to see others passwords.
when you want to check if players enterd password matches with hashed password in database, you just hash player entered password and compare hashes.
Quote:
Originally Posted by Kraeror
Посмотреть сообщение
Today I did it, I had the same question, so I found it! Just use Whirlpool and hash password.
Something like this:

At the top of your gamemode:
PHP код:
native WP_Hash(buffer[], len, const str[]); 
To your OnPlayerDialog (if your login/register (It's the same in the both- login and register) system is using that else just replace inputtext with the variable you want):
PHP код:
new HashedPassword[129];
WP_Hash(HashedPasswordsizeof(HashedPassword), inputtext); 
And you have to use the same hashing method in PHP!

Like this:
PHP код:
$ThePassword strtoupper(hash("whirlpool"$_POST['Password'])); 
You have to download Whirlpool plugin firstly!
firstly, understand my post. secondly, my problem is done.