MD5 implementations

I’m going to try to collect all the open-source MD5 implementations that I know of, in this post. I’ll extend this to all useful cryptographic hash functions. I’m going to supply them directly as links here (for posterity’s sake), but also include links to as original sources. One reason to do this is to find or create a really fast one; all of the ones I’ve seen so far are reasonable, but not speedy.

MD5 Homepage (unofficial) is Mordechai Abzug’s collection of MD5 information.

1991, RSA (Ron Rivest)

RFC 1321: The MD5 Message-Digest Algorithm

Ron Rivest and RSA released MD5 in an open-source fashion in 1992 in the appendix of RFC1321, along with test vectors. The method listed in the RFC source – context, init-func, update-func, finalize-func – has been followed pretty faithfully ever since.

1993, Collin Plumb

MD5 Command Line Message Digest Utility

Collin Plumb wrote the first public-domain implementation of the MD5 algorithm in 1993, and his code was “hacked slightly by John Walker to turn it back into K&R”. This might need to be credited to the combination of Collin Plumb, Branko Lankester, Ian Jackson and Galen Hazelwood.

1999, L. Peter Deutsch/Aladdin


L. Peter Deutsch also wrote his own version of MD5 from RFC 1321, in order to have something with a more BSD-like license.

2001, Alexander Peslyak

A portable, fast, and free implementation of the MD5 Message-Digest Algorithm (RFC 1321)

Alexander Peslyak (posting as Solar Designer,, wrote an OpenSSL-compatible version of MD5 in 2001.

 2012, Nayuki Minase

Fast MD5 hash implementation in x86 assembly

Nayuki Minase optimized an MD5 implementation for speed. The assembly version is 10% faster than the C version, but the impressive part is that the C version is 390 MiB/sec, just short of OpenSSL’s speed of 410 MiB/sec. The speeds reported are on a Core2 Q6000 with a 2.4 Ghz clock speed, but the limiting factor might be memory access speeds, not CPU speed itself.

The code is specifically not open-source, although the source code is available, so it’s really more of a data point, and not something that can be used (without licensing).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>