SA-MP Forums Archive
MD5 problem... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MD5 problem... (/showthread.php?tid=496835)



MD5 problem... - TheSy - 24.02.2014

Good evening to you.

So now, I use my PHPbb forum.
I as a project to link accounts PHPbb my SAMP server.
So what I do:
- When someone registers on the forum, the password is encrypted with MD5.
- If someone logs on the server and it does not account forum = Kick.
- By cons, if any, it can connect to, and must enter the password to connect to the forum.

And that's the problem, as it is encrypted in MD5, how to compare the password for the forum to be compatible with the GM?

Thank you.


Re: MD5 problem... - Emmet_ - 24.02.2014

This plugin has an MD5 cryptographic hashing function:

https://sampforum.blast.hk/showthread.php?tid=152682

pawn Код:
new
    str[128];

md5(inputtext, str);
However, MD5 is horribly insecure nowadays - I would advise you stick to your own account system as players should use different passwords for every resource.


Re: MD5 problem... - ColeMiner - 24.02.2014

I would advise AGAINST using your own account system because as insecure as MD5 may be, your own system will be worse! That at least was devised by experts. If you can, get one that uses bcrypt and salts.

Anyway, in answer to your original question - you have to compare the hashes, not compare the passwords. If you want to know if an entered password is correct, hash it with MD5 (be careful with case), and compare that result with the hash stored in your database. There is no way (or shouldn't be) to get the original password from the stored hash. PHPBB may also run several rounds of MD5 hashing - check how many times they re-hash the result and do the same in your code.


Re: MD5 problem... - TheSy - 24.02.2014

I want to know how to use an already hashed password to use to connect to my server ..


Re: MD5 problem... - TheSy - 24.02.2014

FOR SHA1 PLEASE


Re: MD5 problem... - ColeMiner - 24.02.2014

Exactly what I already said, but replace "MD5" with "SHA1".


Re: MD5 problem... - TheSy - 24.02.2014

I went to FluxBB, but suddenly it is SHA1.
So how to check the hash to connect to the server with the same password forum?


Re: MD5 problem... - ColeMiner - 24.02.2014

Have you even READ my first post?


Re: MD5 problem... - TheSy - 24.02.2014

Yes I looked, it is not possible to do so?


Re: MD5 problem... - iZN - 24.02.2014

It is possible, just try to do it by yourself. Nobody will provide whole code for you. If you have some bugs with it, you can again post with your codes so anyone could assist.