Hash functions

MD4

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

broken Root API only
Broken tier.

Practical attacks exist. Present for compatibility and research only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.

About MD4

MD4 is one of 3 MD2, MD4 and MD5 variants in the NextSSL registry, a cryptographic hash function. It produces a 16-byte (128-bit) output. Its registry entry cites RFC 1320. NextSSL lists it in the broken tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).

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)

Sizes

FieldBytesMeaning
out16Output

Use it

from nextssl_demo import NextSSL

root = NextSSL(root=True)   # tier 'broken' is reachable from the root API only
digest = root.call("hash_with", "md4", None, b"abc")[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Other MD2, MD4 and MD5 variants

2

Frequently asked questions

What is MD4?

MD4 is a hash in the MD2, MD4 and MD5 family. MD2, MD4 and MD5 are 128-bit hash functions designed by Ron Rivest between 1989 and 1992.

What are the MD4 sizes?

In NextSSL, MD4 uses: output 16 bytes.

Who designed MD4 and when?

MD4 belongs to the MD2, MD4 and MD5 family, first published by Ron Rivest. Its origin: RFC 1319, RFC 1320, RFC 1321.

Which standards define MD4?

MD4 is referenced by RFC 1320.

Is MD4 safe to use?

MD4 is in the broken tier. Practical attacks exist. Present for compatibility and research only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).

What other MD2, MD4 and MD5 variants are there?

NextSSL also registers md2, md5 in the MD2, MD4 and MD5 family.