Author Topic: Problems with MD5String  (Read 1191 times)

0 Members and 1 Guest are viewing this topic.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Problems with MD5String
« on: October 12, 2009, 07:23:18 pm »
I am trying to use md5string for my newest script's passwords but when i compair the old saved string with the newly md5ed string its showing negative. (i know im going to feel really dumb when i see the answer)

Here is the output (given and encrypted on top {md5string(pass)} and on bottom temp[0])
Code: [Select]
06d80eb0c50b49a509b49f2424e8c805
06d80eb0c50b49a509b49f2424e8c805

Here is the comparason code:
Code: [Select]
if md5string(pass) = temp[0] then begin

I just dont get what the problem is...


Thank you.


Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Problems with MD5String
« Reply #1 on: October 12, 2009, 11:46:16 pm »
Been there, done that. In server version 2.5.4.
It looks to make it correctly readable you need to manually edit the string if it is saved in a .ini file, even if you have the same result.

Also, ill repeat what Bob told me for the MD5 strings: "Why the fuck do you use a MD5 string if not to hide the password from yourself?"
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Problems with MD5String
« Reply #2 on: October 13, 2009, 02:20:38 am »
Also, ill repeat what Bob told me for the MD5 strings: "Why the f**k do you use a MD5 string if not to hide the password from yourself?"

Well seing as its a scriptcore error and not a personal fail i think i have a solution (ill try it tommarow).

And about what i quoted, some users complained that their passwords were visable and successfull use of md5 will allow me to put uncrackable master passwords in scripts.


Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Problems with MD5String
« Reply #3 on: October 13, 2009, 06:11:55 am »
that function stuffs up from time to time, there were some threads about it on this forum, but this is all i could find: http://forums.soldat.pl/index.php?topic=26492.0 =(

Anyway, some of the ways to check if you generated a valid MD5 hash are to check if its length is 32, or do a regex if you want to be really sure ( if (RegExpMatch('^[0-9a-f]*$',pass) = false) or (length(pass) < 32) then dostuff() ).

Or make a loop of your choice with that check

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Problems with MD5String
« Reply #4 on: October 13, 2009, 10:21:37 am »
MD5String was bugged, and is fixed in the most recent version (or next version, I forget) of scripting core. There are many options to work around this for the most part, as danmer already gave one. I prefer doing a loop and making sure that all the regexs are equal the n times it does it. if not, it'll retry.
If you are reading the md5 string (temp[0]) from a file, be sure you do not have \r, \n, or \r\n as apart of the read file. Note that ReadFile is funny when it comes to adding line breaks at the end of the file:
'' -> ''
'foo' -> 'foo\r\n'
'foo\r\n' -> 'foo\r\n'
'foo\r\nbar' -> 'foor\r\nbar\r\n'
...
at least for the tests i did a while ago on Windows XP.

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Problems with MD5String
« Reply #5 on: December 16, 2009, 09:07:21 pm »
Hey, i'm bringing up an old topic, i know, but i have the same PROBLEM.

Is there a way how could i fix it ?

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Problems with MD5String
« Reply #6 on: December 16, 2009, 09:24:07 pm »
Code: [Select]
copy(httpencode(md5string(pass)),0,25)You dont need the whole string, i have absolutely no idea why it doesnt detect them being the same, but the first 26 characters will always be different even if the pre-md5 string is quite similar.


Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Problems with MD5String
« Reply #7 on: December 17, 2009, 02:19:43 am »
btw, simple password like your can be decoded.
There are some databases of md5 hashes... you can google it ;)
KAWAAAAAAAIIIIIIIIII