WhirlPool Hash on PHP
#1

How would I Whirlpool Hash this ( Login Script)
PHP код:
$account $model->getUser($input["user"], $input["pass"]) 
Reply
#2

PHP код:
hash("whirlpool"$string); 
PHP код:
$account $model->getUser($input["user"], hash("whirlpool"$input["pass"])) 
http://us2.php.net/manual/en/function.hash.php
Reply
#3

http://lmgtfy.com/?q=Whirpool+hash+in+PHP
Reply
#4

SO do I just place that code right under the other?
and Do I need to change the $string in the hash function to anything or leave it?
Reply
#5

Re-read my post. I've updated it.

Something that could make your life easier would be creating a hash class then using that class for salts also.
Reply
#6

Here is an example of what I did;

Код:
if (isset($_POST['UserName'])) {
  $loginUsername=$_POST['UserName'];
  $password=$_POST['Password'];
  $password = strtoupper(hash("whirlpool",$password));
  $MM_fldUserAuthorization = "playerMDCLevel";
  $MM_redirectLoginSuccess = "cpanel.php";
  $MM_redirectLoginFailed = "errors.php?ErrorID=2";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_lspd, $lspd);
There are 100000 other ways to do it. (don't copy mine code as it won't work with yours.
Reply
#7

Quote:
Originally Posted by Mark_Weston
Посмотреть сообщение
Here is an example of what I did;

Код:
if (isset($_POST['UserName'])) {
  $loginUsername=$_POST['UserName'];
  $password=$_POST['Password'];
  $password = strtoupper(hash("whirlpool",$password));
  $MM_fldUserAuthorization = "playerMDCLevel";
  $MM_redirectLoginSuccess = "cpanel.php";
  $MM_redirectLoginFailed = "errors.php?ErrorID=2";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_lspd, $lspd);
There are 100000 other ways to do it. (don't copy mine code as it won't work with yours.
If your using mysql then you shouldn't be coding PHP. A good developer will always keep up to date with new syntax. You should be using mysqli.
Reply
#8

As other people have said, use the hash() function. However, you should make sure you capitalize the string using strtoupper(). The SA-MP Whirlpool plugin capitalizes all strings, and you'll prevent any inconsistencies by matching the cases.

Quote:
Originally Posted by Isolated
Посмотреть сообщение
If your using mysql then you shouldn't be coding PHP. A good developer will always keep up to date with new syntax. You should be using mysqli.
This is a pointless thing to say. There is nothing wrong with the old MySQL code, some people write better code in procedural.
Reply
#9

Quote:
Originally Posted by Calgon
Посмотреть сообщение
The SA-MP Whirlpool capitalizes all strings
Why would a hash not be case-sensitive? This seems wrong to men, or do you mean the hashed string is all caps?
Reply
#10

Quote:
Originally Posted by Joe Staff
Посмотреть сообщение
Why would a hash not be case-sensitive? This seems wrong to men, or do you mean the hashed string is all caps?
The hashed string from the Whirlpool plugin is in uppercase, and PHP's hash() function returns the hashed string in lowercase?..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)