Jump to content

md5() hash keys?


cokacola

Recommended Posts

Hello, I am currently rewriting my login system to work with a current database of users, but I have run into a problem.

Users must sign up on the website, but when they sign up, PHP encrypts the password with the format md5(password,key);

I tried doing that in MTA, but md5(password) and md5(password,key) appeared to return the exact same output.

Is this intentional, or a bug?

Anyway, is there someway around this? because if not, it may become a problem for me.

Thanks, if you can help :)

P.S. When I saw the new site and forum theme, I loved it. Also, its nice to see MTA up there in the 15 modders thing, with garry himself(love playing Garry's Mod)

EDIT:

One more thing, does MTA use the Gamespy protocol or something similar(I am trying to config a game panel script, but it has not custom config for MTA)

EDIT2:

Wow, I am blind.

There they are in the config for the script: "Multi Theft Auto", "Multi Theft Auto: San Andreas" and "Multi Theft Auto: Vice City".

How did I miss that...

So, never mind the protocol thing.

Link to comment

Users must sign up on the website, but when they sign up, PHP encrypts the password with the format md5(password,key);

I tried doing that in MTA, but md5(password) and md5(password,key) appeared to return the exact same output.

i dont understand you..

https://wiki.multitheftauto.com/wiki/Md5

http://php.net/manual/en/function.md5.php

what is that "key"?

if you will do md5(some_string, whatever) it will count md5 hash from some_string and ignore the rest ... ? becouse it have only one argument..

Link to comment

The PHP MD5 says it only has 1 argument, but if you add 2, it seems to hash them togeather or something, but MTA's MD5 returns the same string.

I know, as I use the PHP's MD5 all the time.

EDIT:

I might try and add the password and the key togeather with .. to see if it returns the same as PHP would with pass,key.

Link to comment

Yea, thats what I thought.

I tried the 2, actually, in php I done md5("lol","25");

and got an overly hashed password, and in MTA I tried md5("lol".."25"); and the 2 returned completely different results.

Also, MD5 in MTA returns uppercase, where PHP returns lowercase.

I may need to use that PHP sdk and send the request to PHP...

Link to comment

I am simply trying to encrypt a password to work with a password in a mysql database, but the password in the database was encrypted using PHP, and a very long hash key(WHY do I keep mixing encrypt and hash up? ^.^), but the password generated with PHP was done like this:

include("acckey.php");
md5($password,$acckey);

Of course, that sure isn't the entire registration script.

So, I am currently looking up the PHP SDK script in the wiki, for MTA, so I can have PHP encrypt it the same way it does when someone registers.

Also, I am not so great with PHP's file functions, so if you are, do you mind if I PM you a question about something?

Link to comment
md5 is nice but if you use a SQL Database for example phpmyAdmin MySQL you should swap

to sha1 and sha2. It´s even more secure than md5 hash, im using it myself to save our Accounts.

.

http://www.golubev.com/hashgpu.htm

dont use md5 and sha1 if you care about security..

but..

its game..

nobody will hack the server, to gain access to database, then get md5 hashes to recover original passwords, and then... i dont know what.. steal virtual money from one rpg server and give all to one player?:P

ban & database backup restore

Link to comment

In this case, I would not worry about hacking, because the server is local, and not on the internet.

The only person here who might have a chance of hacking it is me, and I don't really need to do that, because I already have the database password ^.^

Link to comment
steal virtual money from one rpg server and give all to one player?:P

yep i would do that.

The point is many Player/Administrators uses the same passwords for the Board / Forum / Email Account

and Mta Server. It´s just for preventing problems :)

And you can also use sha1 + sha2 Hash´s + other Hash´s = unbreakable.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...