SA-MP Forums

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 14/04/2015, 09:48 PM   #1
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,516
Reputation: 433
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


https://github.com/Southclaws/samp-whirlpool/releases4


(Note: These links no longer work. See above.)
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; 25/01/2018 at 02:56 AM.
Abagail is offline   Reply With Quote
 

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 03:12 AM
Plugin whirlpool Paldi Server Support 2 24/10/2014 09:35 AM
[FilterScript] Whirlpool without plugin EmpireSk Filterscripts 7 12/09/2014 02:36 PM
Whirlpool Plugin Leighton Server Support 3 16/04/2014 12:24 PM
Plugin > Whirlpool TheReplay1995 Server Support 1 14/01/2013 02:33 AM


All times are GMT. The time now is 11:20 AM.


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