PDA

View Full Version : MD5 Message-Digest Algorithm Implementation



Useless Hacker
23-07-2004, 09:06 PM
As part of a project I am working on, I implemented the MD5 message-digest algorithm (RFC 1321 (http://www.faqs.org/rfcs/rfc1321.html)) in Delphi. Yes, there are already loads of delphi/pascal implementations out there, but I like re-inventing wheels, and IMHO, my wheel is a lot rounder than many of the others! :?

But anyway, I thought I would upload it onto the web in case anyone finds it useful. Everything is done in pure Delphi, and no external libraries are used apart from System obviously. And there are even comments. The bulk of the code is translated from the reference C implementation; I have absolutely no idea how it works :) , but it does.

The files:
MD5.pas (http://legion.gibbering.net/miketrim/delphi/MD5.pas) - the core library, based on the reference C implementation.
MD5Util.pas (http://legion.gibbering.net/miketrim/delphi/MD5Util.pas) - additional functions to simplify the conversion of MD5 checksums to strings and vice versa; and to find the MD5 digest of a string or file.

Hope someone finds them useful.