Link to home
Start Free TrialLog in
Avatar of geoffdb
geoffdb

asked on

Indy MD5 - Inconsistent results

I have Delphi 6, and am using the TIdCoderMD5 component to create an MD5 hash, implemented to derive an intended identical hash from a string of typically 50-150 chars.    In fact, I have three strings of 10-50 chars and use one as the seed and concatenate the other two together to create the message to be hashed.

This works fine MOST of the time, (say 99%+), but occasionally (and only occasionally) I'm finding the same component generates different hashes in the two programs.   I have checked the inputs to ensure they are identical - and they are ...

Is this version a bit flakey ?  

I see other versions mentioned in this forum.   Are there other implementations of MD5 that others have used and proved as reliable. ?

Input appreciated.
Geoff

Avatar of Lee_Nover
Lee_Nover

what indy version ? get the lates and check with that
if the problem still persists .. change to something else
like DEC: http://www.delphi32.com/vcl/3267/
ASKER CERTIFIED SOLUTION
Avatar of BlackTigerX
BlackTigerX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geoffdb

ASKER

Lee & Black Tiger

Thanks for your responses.  

I don't know what the version is, the Indy help file doesn't say, and I couldn't directly find anything in the source files either.   Its the one that came with Delphi 6.

Anyway, I've done some of my own testing, set up a routine that i can create 10k, 50k or 100k hashes, write these to disk (incld.the source data and hash), then read this data back in a second process, recalc the hash & compare with the original hash.   Even at 10,000 hashes I always got an error with the Indy version.   Not only that, it chewed up memory.

Using the same code, I replaced the Indy MD5 routine with a) the fichter one above, and b) the TurboPower Lockbox version - and found they both ran sweet, no different hashes, and no memory probs.  !!!

Interesting !!   I'm already using TP Lockbox so think I'll run with this.

Thanks
Geoff
great! =o)

thanks for sharing your tests