The Message-Digest 5 Algorithm

Christoph Grein

Last Update: 4 Nov 2005

The official description of this algorithm could be found until late 1999 on the site of the RSA Data Security, Inc. By mid of 2000, I found that it had been removed, presumably because RSA felt it was obsolete. You can still find it in the download file below. The following is a quote from this description.

The algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. The MD5 algorithm is intended for digital signature applications, where a large file must be "compressed" in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA.

A Reference Implementation in the C language was also given together with the desciption. In this paper, a direct translation into Ada is presented. It was originally written by Rolf Ebert, who had posted it long ago in the news group Comp.Lang.Ada, together with the necessary RSA copyright information. When I however found it in the net, the copyright information had disappeared and also the author's address.

Except for some minor code changes, I only added comments and again the references to the RSA Data Security, Inc. to Rolf Ebert's original code to make its publication conform to the RSA copyright.

Download together with the official description in zip format.

Updates Reason
4 November 2005 Added Win32_Utilities (were forgotten in previous release)
24 October 2005 Added a GUI
11 October 2005 Made implementation portable and used an Ada 2005 feature
in between A few updates for documentation reasons
19 January 1999 First release
On 5 Dec 2001, Simon Wright informed me about a well-hidden restriction on the right to provide links to the RSA web site. You can find this on the legal subpage at the very bottom of the RSA home page entitled "Terms of Use and Privacy Statement". It says that any link to this web site without written permission is prohibited (which is pretty ridiculous IMHO). Thus I only quote the address here:

The following is based on a note by Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK.

Actually, MD5 is now a bit out-dated since Hans Dobbertin has found a way to generate collisions with it. The two state-of-the-art ISO/IEC 10118-3:1998 standardized secure hash functions are called SHA-1 and RIPEMD-160. The first one is also available as an Ada implementation.

A secure hash value alone is not much useful, because the published list of hash values could also be a fake.