Solved

Indy MD5 - Inconsistent results

Posted on 2004-10-09
4
902 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now