Raised This Month: $ Target: $400
 0% 

How to use the new md5 function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
remain
Member
Join Date: Aug 2004
Old 09-12-2004 , 15:13   How to use the new md5 function
Reply With Quote #1

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
remain is offline
BAILOPAN
Join Date: Jan 2004
Old 09-12-2004 , 16:00  
Reply With Quote #2

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
__________________
egg
BAILOPAN is offline
remain
Member
Join Date: Aug 2004
Old 09-12-2004 , 17:35  
Reply With Quote #3

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
remain is offline
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-13-2004 , 16:31  
Reply With Quote #4

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.
Anpheus is offline
remain
Member
Join Date: Aug 2004
Old 09-13-2004 , 16:45  
Reply With Quote #5

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
remain is offline
BAILOPAN
Join Date: Jan 2004
Old 09-13-2004 , 17:19  
Reply With Quote #6

Please post in the bug report forum, as it seems to be a bug indeed
__________________
egg
BAILOPAN is offline
remain
Member
Join Date: Aug 2004
Old 09-13-2004 , 17:44  
Reply With Quote #7

I posted it to the Bug Report forum.

Thanks
remain is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 09-13-2004 , 18:17  
Reply With Quote #8

Can you post the code that you modifed? I suspect that you didn't md5 the right thing..
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
remain
Member
Join Date: Aug 2004
Old 09-14-2004 , 03:20  
Reply With Quote #9

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



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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