PAWN Hashing Algorithm
#1

Hello everyone!

I'm currently developing the base admin system for use in my future gamemodes, and I'd like to keep it extremely simple, and by simple I don't really want any plugins to be used with it. What I am looking for is a hashing algorithm that is written in pure PAWN so that it doesn't require a plugin, that is secure at the same time. I'm trying to keep everything to one script here to make it as portable as possible.

Thanks in advance!

PS: Apologies if this is the incorrect section, could an admin move the thread to the appropriate section if this is the case.
Reply
#2

You wanted some hashing algorithm which is written in PAWN and also it needs to be secure. It's not possible, they're decryptable easily. I'd use whirlpool plugin instead instead of writing or searching for some ready made hash algorithm. Anyway, I found some udb hash (it's not secure, but if you still wanted to have the hash, you can use this) I still prefer using the whirlpool hash instead of this.

pawn Код:
// credits to whoever made this
stock udb_hash(buf[], length = sizeof(buf))
{
    new s1 = 1, s2 = 0, n;
    for (n = 0; n < length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1) % 65521;
    }
    return (s2 << 16) + s1;
}
Reply
#3

Quote:
Originally Posted by iZN
Посмотреть сообщение
You wanted some hashing algorithm which is written in PAWN and also it needs to be secure. It's not possible, they're decryptable easily. I'd use whirlpool plugin instead instead of writing or searching for some ready made hash algorithm. Anyway, I found some udb hash (it's not secure, but if you still wanted to have the hash, you can use this) I still prefer using the whirlpool hash instead of this.

pawn Код:
// credits to whoever made this
stock udb_hash(buf[], length = sizeof(buf))
{
    new s1 = 1, s2 = 0, n;
    for (n = 0; n < length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1) % 65521;
    }
    return (s2 << 16) + s1;
}
Ahh okay... Thank you anyway, it's a pity to hear that PAWN isn't cryptographically secure. I might try a PHP script over a HTTPS connection but for now I will use the Whirlpool plugin. There's no way in hell I'd ever use Alder32 (udb_hash) or MD5... ^_^
Reply
#4

Quote:
Originally Posted by ROMDash
Посмотреть сообщение
I might try a PHP script over a HTTPS connection
1) Very slow.

2) Not secure. (even though you're using TLS)
Reply
#5

Quote:
Originally Posted by Djole1337
Посмотреть сообщение
1) Very slow.

2) Not secure. (even though you're using TLS)
  1. I would use local Apache server.
  2. Faster for more hashes, just the response time that would slow it down.
  3. I thought SSL was secure?
Reply
#6

Why not just use a plugin? I don't understand the problem if you're willing to resort to HTTP(). Also, you can't use https over HTTP().

This plugin has many different methods and should be suitable for you: https://sampforum.blast.hk/showthread.php?tid=152682

There is no real disadvantage to using a plugin, apart from operating system compatibility. Simple encryption plugins do not require updating for new versions of SA-MP and should never break in functionality.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)