[Include] Hash.inc ─ Hash value generator using PHP
#14

Quote:
Originally Posted by shitbird
Посмотреть сообщение
and would it not be a bit inefficient?
No. Depends on what you actually mean by "inefficient". This will be even more "efficient" for your server as the hash does get generated by my free hosted website. If you mean the time it takes to get the result, it won't even take more than half a second in most cases to get the value generated in your preferred algorithm.

Quote:
Originally Posted by shitbird
Посмотреть сообщение
The only possible way I see, is that you hash the given password, from let's say a dialog, using Hash(MD5, x,inputtext). And then, you assign a variable to the playerid, who just submitted the text.

Next, you want to loop through all the players online, to find out who exactly submitted the code, and after that, amend the hashed password to his file/file-on-database.
No need for that. As I mentioned in the first post, you can use playerid as index in the second parameter of Hash.

Quote:
Originally Posted by shitbird
Посмотреть сообщение
Furthermore, how do you read the password with this include?
Same as how you register the player (see example below).

Quote:
Originally Posted by shitbird
Посмотреть сообщение
Wouldn't you be forced to use MySQL's ability to read hashes?
I'm sorry, didn't quite understand that one.

Quote:
Originally Posted by shitbird
Посмотреть сообщение
If so, wouldn't it be a lot easier to simply use the MD5 hasher that comes with MySQL. Or ******'s whirlpool plugin?
Well, if you need MD5 and you're using MySQL, it's better to use the MD5 hash functionality of MySQL. For all other hashes (SHA, Whirlpool, ...) I still recommend this. You will probably agree after seeing the example.

I quickly created a register/login system using MySQL with Whirlpool hasing using my include.
http://pastebin.com/V1vsNBcZ

I just tested it and it works as expected without any problems nor delays. Here's the table (players.sql) if you'd like to test it either:
pawn Код:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE IF NOT EXISTS `players` (
  `Name` varchar(24) NOT NULL,
  `Password` varchar(129) NOT NULL,
  `Score` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `players` (`Name`, `Password`, `Score`) VALUES
('RyDeR', 'cce08bba3f2e3c029cd257104b06d4b075772d5f514cf1b7789506f9a69d53c51464881d2c18445ab290553b302f67a24b1c69e3e737a46215deaf43517e4960', 999999);
As you can see, my (Whirlpool) password "12345" is generated correctly into my table.
Reply


Messages In This Thread
Hash.inc ─ Hash value generator using PHP - by RyDeR` - 19.02.2012, 15:29
Respuesta: Hash.inc ─ Hash value generator using PHP - by SuperMarioRol - 19.02.2012, 15:48
Re: Hash.inc ─ Hash value generator using PHP - by [XST]O_x - 19.02.2012, 17:12
Re: Hash.inc ─ Hash value generator using PHP - by royal_king - 19.02.2012, 17:33
Re: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 19.02.2012, 23:16
Re: Hash.inc ─ Hash value generator using PHP - by Modrlicc - 20.02.2012, 11:38
Re: Hash.inc ─ Hash value generator using PHP - by Niko_boy - 20.02.2012, 12:24
Re: Hash.inc ─ Hash value generator using PHP - by Kaperstone - 20.02.2012, 14:38
Re: Hash.inc ─ Hash value generator using PHP - by iZN - 20.02.2012, 15:20
Re: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 20.02.2012, 16:23
Respuesta: Hash.inc ─ Hash value generator using PHP - by [Nikk] - 20.02.2012, 17:10
Re: Respuesta: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 21.02.2012, 14:27
Re: Hash.inc ─ Hash value generator using PHP - by shitbird - 21.02.2012, 14:59
Re: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 21.02.2012, 17:44
Re: Hash.inc ─ Hash value generator using PHP - by DRIFT_HUNTER - 21.02.2012, 17:48
Re: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 21.02.2012, 17:51
Respuesta: Re: Respuesta: Hash.inc ─ Hash value generator using PHP - by [Nikk] - 21.02.2012, 17:54
Re: Hash.inc ─ Hash value generator using PHP - by shitbird - 21.02.2012, 18:17
Re: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 21.02.2012, 21:27
Re: Hash.inc ─ Hash value generator using PHP - by Modrlicc - 22.02.2012, 17:00
Re: Hash.inc ─ Hash value generator using PHP - by Slash_ - 22.02.2012, 17:13
Re: Hash.inc ─ Hash value generator using PHP - by Slice - 22.02.2012, 17:40
Re: Hash.inc ─ Hash value generator using PHP - by RyDeR` - 23.02.2012, 17:30

Forum Jump:


Users browsing this thread: 2 Guest(s)