Author Topic: Improved Hashing Module  (Read 10860 times)

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Improved Hashing Module
« on: January 06, 2013, 09:20:08 am »
Stormeus' Improved Hashing ( lu_hashing2 )

This module is an improvement and a variant of Liberty Unleashed's lu_hashing module, which ships with the server. This version offers a wider variety of hashing functions which are more secure, while still offering backward-compatibility by allowing the use of the SHA1 and (insecure!!) MD5 algorithms.

Functions
Acceptable for password hashing and storage
  • SHA224( szString )
  • SHA256( szString )
  • SHA384( szString )
  • SHA512( szString )
  • RIPEMD128( szString )
  • RIPEMD160( szString )
  • RIPEMD256( szString )
  • RIPEMD320( szString )
  • WHIRLPOOL( szString )
NOT acceptable for password hashing and storage.
  • SHA1( szString )

    Algorithmically weak and contains weaknesses that make it relatively easy to crack. This function is only provided for backwards-compatibility. If you are creating a new script, DO NOT USE THIS.

  • MD5( szString )

    MD5 has flaws in its algorithm that allows it to be broken relatively easily. This function is only provided for backwards-compatibility. If you are creating a new script, DO NOT USE THIS.

  • base64_encode( szString )
    base64_decode( szString )


    base64 is easily encoded and decoded. Storing passwords with base64 is not recommended ever because it is extremely easy to reverse.

Installation
Extract lu_hashing2.dll/so to your Modules folder. Place this line of code somewhere in onScriptLoad:
     LoadModule( "lu_hashing2" );

Download
Windows binary [.dll]
Linux binary [.so]
Source code

Test script [.nut]

Screenshot
« Last Edit: July 23, 2013, 05:14:06 am by stormeus »
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

Juppi

  • Developer
  • Jr. Member
  • *****
  • Posts: 86
  • Karma: +3/-1
    • View Profile
    • Kuslahden alaste GTA:MP clan
Re: Improved Hashing Module
« Reply #1 on: January 06, 2013, 10:30:19 am »
Very nice work :)

I would recommend people to replace the default hashing module with this one, no script changes are required since the module is backwards compatible with the old one. (Still, get rid of those MD5'd passwords you all!)

GuenosNoLife

  • Jr. Member
  • **
  • Posts: 77
  • Karma: +12/-14
    • View Profile
Re: Improved Hashing Module
« Reply #2 on: January 06, 2013, 10:51:00 am »
Very nice work :)

I would recommend people to replace the default hashing module with this one, no script changes are required since the module is backwards compatible with the old one. (Still, get rid of those MD5'd passwords you all!)

Okay, thank's Stormeus for this security :D
Little back... Maybe not maybe yes...

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Improved Hashing Module
« Reply #3 on: January 06, 2013, 01:41:14 pm »
oooh fancy. Nice work :o

NC

  • Full Member
  • ***
  • Posts: 101
  • Karma: +2/-3
  • cipa
    • View Profile
Re: Improved Hashing Module
« Reply #4 on: February 25, 2013, 01:25:55 am »
MD5 insecure, reallllllllllyyyyy?

Website online:
My YT channel: http://www.youtube.com/user/1234sdg131

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Improved Hashing Module
« Reply #5 on: March 01, 2013, 03:02:31 am »
MD5 insecure, reallllllllllyyyyy?
It actually is in comparison to many others. Being that it was the most popular hashing method throughout the world for a very long time, it has become very easy to crack because so many people had focused on reversing it.

VRocker

  • Liberty Unleashed Developer
  • Administrator
  • Full Member
  • ******
  • Posts: 342
  • Karma: +43/-15
    • View Profile
    • Madnight Software
Re: Improved Hashing Module
« Reply #6 on: March 01, 2013, 02:00:52 pm »
MD5 insecure, reallllllllllyyyyy?
It actually is in comparison to many others. Being that it was the most popular hashing method throughout the world for a very long time, it has become very easy to crack because so many people had focused on reversing it.

Its not really a case of 'people took the time to reverse it' since methods to MD5 are open sourced anyway. The issue with MD5 is it is a simple algorithm which doesn't take long to brute force these days thanks to faster CPUs and being able to execute code on a GPU. Bruteforcing an MD5 hash of a simple password can take seconds on a modern powerful GPU.

SHA1 and better are more secure due to the complexity of the algorithm so it takes longer to calculate the hash, slowing down brute force attacks.
Although if someone uses common passwords such as 'password' '123' or similar stupid things then their password can be worked out easily no matter what the hashing method due to rainbow tables.


NC

  • Full Member
  • ***
  • Posts: 101
  • Karma: +2/-3
  • cipa
    • View Profile
Re: Improved Hashing Module
« Reply #7 on: April 07, 2013, 10:28:53 pm »
Okay, so who remembers mIRC scripting in VCMP where passwords were saved as plain text and no one got a problem with it? :)

* NC raises his hand

In my opinion MD5 is still secure. You just have to manipulate the saved password with e.g. salt and pass it a few times through the MD5 hashing function and voilĂ , no one will be able to encode it, unless he doesn't know the instructions.

Btw. let's not forget, that someone has to steal the database with passwords first, in order to get the hashes.

Website online:
My YT channel: http://www.youtube.com/user/1234sdg131

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Improved Hashing Module
« Reply #8 on: April 08, 2013, 12:38:43 am »
If you have no other choice, definitely go with MD5 over plain text...but I would still say that if you can figure it out, go with the most secure thing possible.

Juppi

  • Developer
  • Jr. Member
  • *****
  • Posts: 86
  • Karma: +3/-1
    • View Profile
    • Kuslahden alaste GTA:MP clan
Re: Improved Hashing Module
« Reply #9 on: April 08, 2013, 02:31:52 pm »
Okay, so who remembers mIRC scripting in VCMP where passwords were saved as plain text and no one got a problem with it? :)
Some people also believed that drilling a hole in the head could cure migraine even after the dark ages.

Quote
In my opinion MD5 is still secure. You just have to manipulate the saved password with e.g. salt and pass it a few times through the MD5 hashing function and voilĂ , no one will be able to encode it, unless he doesn't know the instructions.
Your method may bring security through obscurity, but it doesn't fix the design flaws in MD5. Anyone determined enough can still use these exploits and crack the hashes. While this might not be a huge problem for something as small as GTA multiplayers, theres no real reason not to choose a more secure method over MD5 when alternatives are available.


SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Improved Hashing Module
« Reply #10 on: April 08, 2013, 08:42:46 pm »
...theres no real reason not to choose a more secure method over MD5 when alternatives are available.
That part is exactly what I meant too. It's one thing if you know you can't use anything beyond MD5 due to say, compatibility issues with your gamemodes, or a lack of knowledge in using the others...but if you have the knowledge and ability, you should always use the best thing available to you. Purposely not using it and going for something older and outdated that has been known to be easily breached is like asking for someone to hack you when they feel like getting around to it. That is simply not good practice.

NC

  • Full Member
  • ***
  • Posts: 101
  • Karma: +2/-3
  • cipa
    • View Profile
Re: Improved Hashing Module
« Reply #11 on: April 08, 2013, 08:51:46 pm »
Instead of creating new hashing algorithms, we should better secure the databases, so that no one will ever look into it, no matter if passwords are saved as plain text, md5, sha or stormy[256] ;).

And who needs to crack passwords, if most of them are already cracked, just type in google and here are the results.

Website online:
My YT channel: http://www.youtube.com/user/1234sdg131

SugarD

  • Asshat Gaming Founder
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Improved Hashing Module
« Reply #12 on: April 08, 2013, 09:07:57 pm »
Instead of creating new hashing algorithms, we should better secure the databases, so that no one will ever look into it, no matter if passwords are saved as plain text, md5, sha or stormy[256] ;).

And who needs to crack passwords, if most of them are already cracked, just type in google and here are the results.
Those are MD5 hashes that are in Google. As for securing databases, you should already be doing that. You shouldn't be just hiding and protecting your database by itself, though. If it does get breached and you use a crappy hashing system, you're just begging for someone to post your passwords online. Many users make the mistake of using them in multiple locations, and as the owner of the server, you become legally responsible for any incidents that arise from such.

As a result, I would highly suggest you use the highest system available to you, if you can. You should not only prevent breaches in the first place, but also plan for them in the event they do happen. You cannot stop every single attack that ever happens, no matter how much security you have...but you can prevent any damage made from it, from becoming worse if you try hard enough beforehand.

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Re: Improved Hashing Module
« Reply #13 on: July 23, 2013, 05:19:33 am »
SHA1 has been removed from the "acceptable for password hashing" list due to faults in the algorithm that have made it subject to relatively simpler cracking and collision attacks. While these attacks are still expensive to carry out (261 operations for a collision according to latest estimates, which comes at a cost at $2.77mil), it is still highly recommended to avoid using hashing algorithms with existing collision attacks.

TL;DR
It doesn't matter if you use SHA-1 or not since no one is going to spend millions of dollars to crack your server's hashes, but you should still use something more secure anyways.

See more: https://en.wikipedia.org/wiki/SHA-1#Attacks
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

 

© Liberty Unleashed Team.