Overview
Introduction
MD4's real collision break (Wang et al., 2004) is famous for being almost instantaneous once the differential construction was worked out, but that construction is a research-grade result, not something a browser tab should fake or hand-wave as "computed live."
This tool instead runs a genuine, live birthday-attack search: random short strings, hashed with MD4, until two different ones share a truncated digest prefix at a bit length you choose, a real technique, clearly and repeatedly labeled as operating on a truncated digest, not the full 128-bit hash.
What Is MD4 Collision Generator?
A live collision-finding demo built on the birthday paradox: it generates random 6-10 character alphanumeric strings, hashes each with MD4, and tracks the first N/4 hex characters (N bits) of every digest seen.
As soon as two different inputs produce the same truncated prefix, the search stops and reports both inputs, their full MD4 digests, and the shared truncated prefix, a real, verifiable truncated collision computed entirely in your browser.
How MD4 Collision Generator Works
For your chosen bit length (16, 20, or 24), the tool repeatedly generates a random short string via crypto.getRandomValues, computes its MD4 digest, and truncates that digest's hex representation to the first bitLength/4 characters.
Each truncated prefix is checked against every prefix seen so far in this search; a match from two distinct inputs ends the search successfully, while a cap of 200,000 attempts (far beyond what the birthday bound requires) prevents the browser from ever hanging if something goes wrong.
When To Use MD4 Collision Generator
Use this to see the birthday paradox in action: how quickly two random inputs collide on a truncated hash prefix, versus how differently that scales for a full-length collision.
Don't use this as a stand-in for MD4's actual 2004 collision break; that used deliberate differential cryptanalysis to construct specific colliding message blocks, a fundamentally different (and far more consequential) technique than the brute-force search this demo performs.
Often used alongside MD4 Hash Calculator, MD2 Collision Generator and MD5 Collision Generator.
Features
Advantages
- Every result is a genuine, live, verifiable computation, not a canned or faked example.
- Makes the birthday paradox's counterintuitive speed concrete and checkable in seconds.
- Clearly and repeatedly labeled as a truncated-digest demo, avoiding any implication of reproducing MD4's real 2004 full-length break.
Limitations
- Only demonstrates truncated collisions (16-24 bits); finding a full 128-bit MD4 collision by this brute-force technique is computationally infeasible, the real break used differential cryptanalysis instead.
- Bit length is capped at 24 in this tool's UI to keep search time near-instant in a browser tab; the birthday bound would still make higher truncations feasible, just with proportionally more attempts.
- Doesn't construct or explain the specific message-block differentials the real 2004 MD4 break used; it demonstrates the birthday-search technique, not the differential-cryptanalysis technique.
Examples
Best Practices & Notes
Best Practices
- Try increasing the bit length from 16 to 20 to 24 to feel how attempt counts scale roughly with sqrt(2^N), not with N or 2^N directly.
- Don't treat this tool's output as reproducing MD4's real 2004 collision break; that was a targeted differential-cryptanalysis construction, not a brute-force birthday search like this demo.
- Use alongside the MD2, MD5, and Whirlpool Collision Generators to compare truncated-collision search behavior across algorithms with very different real-world security standing.
Developer Notes
Built on this category's shared findTruncatedCollisionSync() helper (in find-truncated-collision.ts), which this tool calls with the existing calculateMd4Hash function. Random candidate strings (6-10 alphanumeric characters) are generated via crypto.getRandomValues, never Math.random(). A 200,000-attempt cap prevents the browser from ever hanging, though the birthday bound (~sqrt(2^N), roughly 256-4,096 expected attempts for the 16-24 bit range this tool offers) means that cap should essentially never be reached.
MD4 Collision Generator Use Cases
- Demonstrating the birthday paradox's counterintuitive search speed live and verifiably
- Teaching the difference between a truncated-digest collision (fast, brute-forceable) and a full-length collision (requires differential cryptanalysis)
- Comparing collision-search behavior across MD2, MD4, MD5, and Whirlpool at the same bit lengths
- Cryptography coursework covering birthday attacks, hash collision resistance, and MD4's historical break
Common Mistakes
- Assuming this tool demonstrates a full-length MD4 collision; it only ever finds a match on a truncated prefix (16-24 bits) of the full 128-bit digest.
- Confusing this brute-force birthday demo with the real 2004 MD4 collision break, which used differential cryptanalysis, a completely different, targeted approach.
- Expecting a similarly fast result from an equivalent tool against SHA-256; no practical collision is known there even at far deeper truncation than this category's demos use.
Tips
- Compare attempt counts across bit lengths to see the sqrt(2^N) birthday-bound scaling directly.
- Try the MD5 Collision Generator or Whirlpool Collision Generator next to contrast a broken hash against one with no known practical collision attack.