Hash family

MD2, MD4 and MD5

Ron Rivest's message-digest hashes; all three are broken and kept for legacy use

broken 3 variants RFC 1319, RFC 1320, RFC 1321

Overview

MD2, MD4 and MD5 are 128-bit hash functions designed by Ron Rivest between 1989 and 1992. MD5 was once ubiquitous, but all three now have practical collision attacks and none should be used for security purposes.

MD4 (RFC 1320) introduced the fast 32-bit Merkle–Damgård design that later shaped MD5, SHA-1 and SHA-2: 512-bit blocks, a small state of 32-bit words and rounds of boolean functions, additions and rotations. MD5 (RFC 1321) added a fourth round and other strengthening for safety margin. MD2 (RFC 1319) is an older byte-oriented design for 8-bit machines, built on a 256-byte substitution table and a checksum block appended to the message.

Collisions for MD4 can be found by hand-scale computation. MD5 collisions were published by Wang and colleagues in 2004, and chosen-prefix collisions were used to forge a rogue CA certificate in 2008 and in the Flame malware in 2012. MD2 has preimage and collision attacks well below generic bounds. All three remain in NextSSL so that legacy formats, NT hashes and old checksums can be computed and verified.

History

1989–2008
  1. MD2 published by Ron Rivest

  2. MD4 published

  3. MD5 published as RFC 1321

  4. Specified in RFC 1319

  5. Specified in RFC 1320

  6. Wang et al. publish practical MD5 collisions

  7. Rogue CA certificate built with an MD5 collision

Security notes

All three are cryptographically broken. MD5 and MD4 collisions are practical in seconds, and MD5 chosen-prefix collisions have been exploited in real attacks. Use them only to interoperate with existing data, never for signatures, certificates or integrity against an adversary.

Typical uses

Verifying legacy file checksumsReading old formats and protocolsComputing NT hashes (MD4)

Variants in NextSSL

3
AlgorithmTierSizes (bytes)StandardsAPI
MD2
md2
broken out 16 RFC 1319 root
MD4
md4
broken out 16 RFC 1320 root
MD5
md5
broken out 16 RFC 1321 root

Frequently asked questions

Which MD2, MD4 and MD5 variants does NextSSL include?

NextSSL registers 3 MD2, MD4 and MD5 variants: md2, md4, md5.