Solved

Indy MD5 - Inconsistent results

Posted on 2004-10-09
4
917 Views
Last Modified: 2012-08-14
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

0
Comment
Question by:geoffdb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 12265856
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/
0
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 100 total points
ID: 12267368
I have never had any problems with these one:

http://www.fichtner.net/delphi/md5.delphi.phtml

full source provided and comes with full examples
0
 

Author Comment

by:geoffdb
ID: 12295859
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
0
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 12347934
great! =o)

thanks for sharing your tests
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question