SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 14/04/2015, 08:48 PM   #1
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,333
Reputation: 389
Default Whirlpool plugin

Whirlpool Plugin for SA-MP
This is a whirlpool plugin for usage within SA-MP. This was originally created by Y_Less, this is merely a repost with updated links and some things moved around. The script doesn't contain an include, the following native should be added manually to your script (or go nuts and make a seperate one line include for it):
Code:
native WP_Hash(buffer[], len, const str[]);

__________________________________________________ ________

Whirlpool

Introduction

Very simple plugin. Just provides an implementation of the whirlpool hash algorithm for PAWN. This is so that you don't need to use bad hash systems like MD5, plain awful ones like Adler32 (UDB_Hash) or ones that aren't even true hashes (encode).

Unlike most other hash functions (MD5 and SHA1 included) there are no known weaknesses in whirlpool, so you can be sure your hashes are secure.

Use

This plugin adds just one function:

Code:
native WP_Hash(buffer[], len, const str[]);

So I didn't bother including an include. To use simply call the function, passing a buffer of at least 129 characters, the size of that buffer and the string you want to hash. This used to say 145 but I have no idea why! You need 128 for the hash and 1 for the NULL terminator

Example
Code:
#include <a_samp>

native WP_Hash(buffer[], len, const str[]);

main()
{
	new
		buf[129];
	printf("hash");
	WP_Hash(buf, sizeof (buf), "The quick brown fox jumps over the lazy dog");
	print(buf);
}
That will output:

Code:
B97DE512E91E3828B40D2B0FDCE9CEB3C4A71F9BEA8D88E75C4FA854DF36725FD2B52EB6544EDCACD6F8BEDDFEA403CB55AE31F03AD62A5EF54E42EE82C3FB35
Which is the correct hash for that string.

Notes

If you use YSI that uses a custom key-based hash algorithm, while there are currently no known cracks for it I do not know exactly how secure it is, however the key system vastly improves it's security from server to server. You may want to consider upgrading to Whirlpool however YSI is the only user system which actually bothered with anything resembling security, so it's not required.

As with all my plugins if you place the folder in your SA:MP directory then compiling the plugin will automatically place the new dll or so in your plugins directory.

Reference

http://en.wikipedia.org/wiki/Whirlpool_(cryptography)

Download
  • Source and windows .dll


http://dl.dropbox.com/u/21683085/Whirlpool.rar

http://www.y-less.com/YSI/Whirlpool.rar
  • 32 bit linux .so


http://dl.dropbox.com/u/18253648/Whirlpool.so (thanks linuxthefish)
http://www.solidfiles.com/d/1fbbc8fcab/ (thanks pyrodave)
http://www.kowaz.hu/downloads/Whirlpool.so (May be dead)
http://files.uploadffs.com/3/2b87364d/Whirlpool.so (May be dead)
http://www.megaupload.com/?d=89KU5FCG (May be dead)
  • 64-bit linux .so


http://www.solidfiles.com/d/688303825c/ (thanks Mark™)

Version

I have no intention of modifying this in any way as it works fine. So as far as I'm concerned this is 1.0.

License

* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Beyond that do what you like with it.

Last edited by Abagail; 27/05/2017 at 02:01 PM.
Abagail is offline   Reply With Quote
Old 14/04/2015, 08:53 PM   #2
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 250
Reputation: 27
Default Re: Whirlpool plugin

Thanks for this. +rep'd for helping
Jakwob is offline   Reply With Quote
Old 14/04/2015, 08:54 PM   #3
Ralfie
High-roller
 
Join Date: Nov 2013
Posts: 1,001
Reputation: 150
Default Re: Whirlpool plugin

Thats way way poor and lacks of explanation. If you are willing to re-distribute the work i suggest you copy and past the original topic, also linking to your own website is somehow selfish.

Anw,

Original example (might be helpful):

Quote:
Code:
#include <a_samp>

native WP_Hash(buffer[], len, const str[]);

main()
{
	new
		buf[129];
	printf("hash");
	WP_Hash(buf, sizeof (buf), "The quick brown fox jumps over the lazy dog");
	print(buf);
}
This will output:

Code:
B97DE512E91E3828B40D2B0FDCE9CEB3C4A71F9BEA8D88E75C4FA854DF36725FD2B52EB6544EDCACD6F8BEDDFEA403CB55AE31F03AD62A5EF54E42EE82C3FB35

Other notes he mentioned:

Quote:
If you use YSI that uses a custom key-based hash algorithm, while there are currently no known cracks for it I do not know exactly how secure it is, however the key system vastly improves it's security from server to server. You may want to consider upgrading to Whirlpool however YSI is the only user system which actually bothered with anything resembling security, so it's not required.

As with all my plugins if you place the folder in your SA:MP directory then compiling the plugin will automatically place the new dll or so in your plugins directory.

Last edited by Ralfie; 15/04/2015 at 02:32 PM. Reason: added an example.
Ralfie is offline   Reply With Quote
Old 14/04/2015, 08:56 PM   #4
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,333
Reputation: 389
Default Re: Whirlpool plugin

Quote:
Originally Posted by Ralfie View Post
Thats way way poor and lacks of explanation. If you are willing to re-distribute the work i suggest you copy and past the original topic, also linking to your own website is somehow selfish.
I honestly don't care about linking to my own site, as I don't have the original link and uploading to mine is faster than uploading to something such as mediafire, or solidfiles. Uploading to mine also allows a direct link whereas mediafire, solidfiles, etc require a button press. And also, I have no way of copy and pasting the topic because it no longer exists. I have edited the post with a brief example, hope that somewhat helps. I have included y_less's original thread which actually has the old mirrors, files, etc, so there is that there.

Last edited by Abagail; 15/04/2015 at 08:53 PM.
Abagail is offline   Reply With Quote
Old 24/04/2015, 03:04 PM   #5
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,333
Reputation: 389
Default Re: Whirlpool plugin

I have created a github for this plugin aswell:
https://github.com/Abagail/Whirlpool-plugin
Abagail is offline   Reply With Quote
Old 24/04/2015, 03:08 PM   #6
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Location: India
Posts: 775
Reputation: 51
Default Re: Whirlpool plugin

hmm, I do not know what to say but you just copy and paste
__________________
KayJ is offline   Reply With Quote
Old 24/04/2015, 03:50 PM   #7
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,333
Reputation: 389
Default Re: Whirlpool plugin

Quote:
Originally Posted by StuartIndia View Post
hmm, I do not know what to say but you just copy and paste
Allow me to fill you in:
Quote:
Originally Posted by Y_Less
I don't want this to sound cliche or anything, but the best I can describe it as is that I am addicted to SA:MP (not even playing it), and I have to move on. Sorry, this is the only way I know how.
Quote:
Sorry...

After 10+ years, I'm done - I need to move on! Sadly, I've tried before and failed, hence the rather drastic measures (that I realise may upset some people).
(http://forum.sa-mp.com/showthread.ph...wpost&t=570795)

He deleted everything: threads, his SA-MP related github stuff, etc - hence why I have reposted this. See: http://forum.sa-mp.com/showpost.php?...&postcount=320 for more.
Abagail is offline   Reply With Quote
Old 01/07/2016, 09:04 PM   #8
vannesenn
Gangsta
 
Join Date: Feb 2011
Posts: 663
Reputation: 15
Default Re: Whirlpool plugin

Something doesn't work as well. Whirlpool hash from PHP returns different hash than this plugin.
I hashed "silvio"(without "), and hash from PHP was
Quote:
623f4045227ce9afe04f8499f65e4ad9392bffcd9cd503b8af bdfa46025da60bcc3ec1ea91d009a1203352be3c28bf21004c 8837c214e199d1d729cd32b8a612
but hash from plugin is different
Quote:
1A4A17973E77944F4B52819EB1E0CDB061F09622B32DFD399C 0AFCEA0F2492F9672A613B94D28CCC628E0BBBE991EA5338CA 087C477D82F2820F35BFB68BE42F
How?
vannesenn is offline   Reply With Quote
Old 01/07/2016, 09:22 PM   #9
SickAttack
Godfather
 
Join Date: Dec 2013
Posts: 5,254
Reputation: 751
Default Re: Whirlpool plugin

Quote:
Originally Posted by vannesenn View Post
Something doesn't work as well. Whirlpool hash from PHP returns different hash than this plugin.
I hashed "silvio"(without "), and hash from PHP was

but hash from plugin is different


How?
No, PHP Whirlpool returns the same hash.

strtoupper(hash('whirlpool', password))
SickAttack is offline   Reply With Quote
Old 01/07/2016, 11:20 PM   #10
vannesenn
Gangsta
 
Join Date: Feb 2011
Posts: 663
Reputation: 15
Default Re: Whirlpool plugin

Yeap, that was a problem. Thanks!
vannesenn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install Whirlpool plugin Osviux Server Support 7 28/01/2015 02:12 AM
Plugin whirlpool Paldi Server Support 2 24/10/2014 08:35 AM
[FilterScript] Whirlpool without plugin EmpireSk Filterscripts 7 12/09/2014 01:36 PM
Whirlpool Plugin Leighton Server Support 3 16/04/2014 11:24 AM
Plugin > Whirlpool TheReplay1995 Server Support 1 14/01/2013 01:33 AM


All times are GMT. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.