[Plugin] Whirlpool plugin
#1

Whirlpool Plugin for SA-MP
This is a whirlpool plugin for usage within SA-MP. This was originally created by ******, 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):
pawn Код:
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:

pawn Код:
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
pawn Код:
#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:

Код:
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.
Reply
#2

Thanks for this. +rep'd for helping
Reply
#3

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:
Код:
#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:

Код:
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.

Reply
#4

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
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 ******'s original thread which actually has the old mirrors, files, etc, so there is that there.
Reply
#5

I have created a github for this plugin aswell:
https://github.com/Abagail/Whirlpool-plugin
Reply
#6

hmm, I do not know what to say but you just copy and paste
Reply
#7

Quote:
Originally Posted by StuartIndia
Посмотреть сообщение
hmm, I do not know what to say but you just copy and paste
Allow me to fill you in:
Quote:
Originally Posted by ******
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.
Reply
#8

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?
Reply
#9

Quote:
Originally Posted by vannesenn
Посмотреть сообщение
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))
Reply
#10

Yeap, that was a problem. Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)