[BINARY] gm_crypt high functional hashing/crypting

I’m sick of bumping Seth’s old thread so I made this one


Just rename it to gmcl_ if you want it clientside.


number crc16(string)
string crc32(string)

string sha1(string data, boolean rawOutput)
string sha224(string data, boolean rawOutput)
string sha238(string data, boolean rawOutput)
string sha256(string data, boolean rawOutput)
string sha512(string data, boolean rawOutput)

string md2(string data, boolean rawOutput)
string md4(string data, boolean rawOutput)
string md5(string data, boolean rawOutput)

string ripeMod128(string data, boolean rawOutput)
string ripeMod160(string data, boolean rawOutput)
string ripeMod256(string data, boolean rawOutput)
string ripeMod320(string data, boolean rawOutput)

string aesEncrypt(string data, string key, string iv)
string aesDecrypt(string data, string key, string iv)

If you have any requests or bug reports, post them IN THIS THREAD.

If you want to use this in order to crypt input/output from a MySQL database, DON’T USE THIS MODULE!

Use the in-built MySQL functionality instead.

Whats the string name of the module so I can require it. I’m unable to require it.

Should be gmsv/cl_crypt_win32.dll given it’s windows, there is no “internal” name.

] lua_run require(“crypt”)
> require(“crypt”)…
Couldn’t include file ‘includes\modules\crypt.lua’ (File not found) (@lua_run (line 1))

Where did you put the module, and what name did you use?


That’s weird, it should work fine, if the module itself was broken it would yell about procedures not being found.

you can make hash with this? I honestly prefer pot.

Beside of that…
This binary module is really useful, thanks for making it :slight_smile:

Actually, noticed the files were down, rehosted and updated.

Nice module.
I haven’t used any encryption stronger than md5 in GMod though.

Linux version here: http://g.iriz.uk.to/~srcds/modules/gm13/bin/ (I think :v:)

MD5 isn’t an encryption algorithm

It’s still got something to do with cryptographing and it’s useful :v:

Hey hey hey.
my CMS nuked klan use a personal method for hash password so i’ll need to do a lua script for hash password before send it to mysql database. Someone know if this method is secure or not ?
Else i have a php function for generate password hashed and i wanna know if i could use it with gmod ?
My last question is : this module is it compatible with linux serv ?

edit :
I believe i found the linux version :

https://bitbucket.org/danielga/gm_crypt : seen on the right of the window.

always wanna know if it’s dangerous to hash the password from server or client then send it to the sql database or if i can use a php function.

Don’t bump 1 year old threads…

why ??? the module from the link is from 2014 and i don’t have knowledge for do this module myself.
Maybe you prefer i post a new post then you could say me “search before post ???” ><’

But thanks you for up my question dude, i always search an answer.

Try rewriting your question in a more comprehensible format.

sorry ^^’ i’m french and have some difficulties with english sometime.

so: because md5 and sha1 is not perfectly secure, my cms, nukedklan, use a php function created by them-self for crypt the password.

The idea is : crypt password with sha1 then hash this first encrypted password with a hashkey randomly define at the cms installation
At the end, the encrypted password is :

“#”…“random variable used for verify password”…“md5(password hashed with previous method)”

So i wrote a lua function for do it with this gmsv_crypt module and after send the password to the mysql database with mysqloo module.

Like that, players can do “!register password” and they subscribe to my website with their IG peudo, the password they say and i can have directly their steamId.

Now, i wanna know if it’s dangerous to do that for my database… Could someone fount the hashkey i’ll put in my serv ftp or the password hashed.

Okay firstly, md5 and sha1 are hashing algorithms. They do not encrypt anything.

Secondly, all the passwords in your database should be hashed already. All you should need to do is have your clients hash their password, send the hash to the server, and have the servers compare the hashes serverside. There are more secure things you can do, but there’s no real reason for you to overcomplicate things.

I know… but it’s difficult to explain clearly what i want to do and you didn’t understand ^^

If someone want register to website from website, the passwords are encrypted from a php algorythm, which use sha1() and md5() php function, include to CMS.

But i want to do a lua script which alow players to register to website from the gmod serveur with a command in chat ( !register [password] ) but i can’t send directly the password to mysql db because like you said they will not be crypted.
So i need to encrypt passwords before send them to sql db. I already do the lua function to encrypt which is almost the same of the php function of the cms but i wanna be sure it is not dangerous before put it on my serv.
So, could someone aspirate/recuparate/suck my script if i put on serverside? clientside ? because there are my sql id and the hashkey used for encrypt passwords.