Raised This Month: $51 Target: $400
 12% 

[CORE] md5 function returns false results. 0.2 rc5


  
 
 
Thread Tools Display Modes
Author Message
remain
Member
Join Date: Aug 2004
Old 09-13-2004 , 17:42   [CORE] md5 function returns false results. 0.2 rc5
#1

I posted it to the scripting help forum.
My Messages are:

Quote:
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.
Quote:
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.
remain is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 09-13-2004 , 18:15  
#2

I CANNOT duplicate this.

(C:\) md5sum test.txt
ce114e4501d2f4e2dcea3e17b546f339 *test.txt

amx_md5
Md5: ce114e4501d2f4e2dcea3e17b546f339

Test.txt
Code:
This is a test
Amx_md5
Code:
#include <amxmodx> public plugin_init() {     register_concmd("amx_md5","domd5") } public domd5() {     new tmp[34]     md5("This is a test",tmp)     server_print("Md5: %s",tmp) }

This is win32-nightly 20040913
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BAILOPAN
Join Date: Jan 2004
Old 09-13-2004 , 20:30  
#3

3 possibilities:

1. You are not using the function properly
2. You are hasing the wrong variable
3. The original md5 is salted
__________________
egg
BAILOPAN is offline
Anpheus
Senior Member
Join Date: Aug 2004
Old 09-13-2004 , 21:52  
#4

Devicenull, does the MD5 sum include any file data (date modified, name, etc?) or purely file contents.
Anpheus is offline
BAILOPAN
Join Date: Jan 2004
Old 09-14-2004 , 00:49  
#5

Since when do md5 sums contain file properties o_O

amx_md5() is straight string
amx_md5file() is straight file contents (binary/text does not matter)
__________________
egg
BAILOPAN is offline
remain
Member
Join Date: Aug 2004
Old 09-14-2004 , 03:18  
#6

I used it like below on admin.sma:

Code:
  if (index != -1) {
    new hash[34]
    md5(g_aPassword[index], hash)
    log_amx("Login: ^"%s^"",hash)
    if (g_aFlags[index] & FLAG_NOPASS){
      result |= 8
      new sflags[32]
      get_flags(g_aAccess[index],sflags,31)
      set_user_flags(id,g_aAccess[index])
      log_amx("Login: ^"%s<%d><%s><>^" became an admin (account ^"%s^") (access ^"%s^") (address ^"%s^")",
        name,get_user_userid(id),authid,g_aName[index] ,sflags,ip)
    }
I think it prints the console the md5 of the given password from the cs client.
remain is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 09-14-2004 , 18:05  
#7

That code there, will hash the password stored in either the sql database, or the file.. not the one you input
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BAILOPAN
Join Date: Jan 2004
Old 09-14-2004 , 18:16  
#8

devnull is correct. this bug is a misreport.

So unless there are any more problems, I'll close this.
__________________
egg
BAILOPAN is offline
remain
Member
Join Date: Aug 2004
Old 09-15-2004 , 02:07  
#9

Ok thanks to all
i will try to fix the code.
sorry for that. I am not good at writing scripts.
You can close this post.
remain is offline
 



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 20:23.


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