AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to use the new md5 function (https://forums.alliedmods.net/showthread.php?t=5783)

remain 09-12-2004 15:13

How to use the new md5 function
 
in the amxmodx.inc file i saw the declaretion is:

/* Calculates the md5 keysum of a string */
native md5(const szString[], md5buffer[34]);

I want to use md5 encrypted passwords so i edit the admin.sma file. The line 290 is:

Code:

else if (equal(password,g_aPassword[index]))
i changed it to :

Code:

else if (equal(md5(password),g_aPassword[index]))
But the compiler gives errors like missing argument.
How can i use the md5 function?

Thanks

BAILOPAN 09-12-2004 16:00

From amxmodx.inc:
Code:
/* Calculates the md5 keysum of a string */ native md5(const szString[], md5buffer[34]);

This mean you must do:
Code:
new hash[34] md5(password, hash) if (equali(hash, g_Password[index]))

Or something similar

remain 09-12-2004 17:35

I make it as you say but there is a weird error.
The md5 of my password is:
8cdee5526476b101869401a37c03e379

but amxmodx's md5 result is:
88bc49ab58742b4b7c68c58a2288ae11

I created the first password with php's md5 function. I put a line that prints the md5 of the password given to the console of the server.
log_amx("Login: ^"%s^"",hash)
When i connect with my password it writes the second password to the server console.

What is wrong with this?

Thanks

Anpheus 09-13-2004 16:31

Unless you're worried about routers actually reading the packets sent between a client computer and the server, there's no point.


And it's not an 'md5 password', it's a hash. You should probably encrypt it by a serverside key.

remain 09-13-2004 16:45

Ok then i want to explain my system.
I have a forum and 4500 users.
The forum is storing the passwords as md5 encrypted on database. I was using adminmod and it supports md5 passwords. But i don't like adminmod and i want to use amxmodx. I have to make the amxmodx to use these passwords. I think that the md5 function is included for this. But i don't understand why it gives a different result as the php gives.

I used the php's md5 function and create an encrypted password, but amxmodx's encrypted password is differs from this password.

Thanks

BAILOPAN 09-13-2004 17:19

Please post in the bug report forum, as it seems to be a bug indeed

remain 09-13-2004 17:44

I posted it to the Bug Report forum.

Thanks

devicenull 09-13-2004 18:17

Can you post the code that you modifed? I suspect that you didn't md5 the right thing..

remain 09-14-2004 03:20

I posted it to the http://forums.alliedmods.net/showthread.php?t=5817


All times are GMT -4. The time now is 17:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.