MD4 explained in plain terms means understanding the hash function that started the modern era of message digests, a design from Ronald Rivest that turns any message into a 128-bit fingerprint in just three rounds. The central question is why a hash everyone agrees is broken still matters at all, and the answer is that MD4 is the ancestor of MD5 and SHA-1, and its flaws taught the field most of what it knows about building hashes that last.
MD4 is a cryptographic hash function designed by Ronald Rivest at MIT and published in 1990, with the specification later recorded in RFC 1320. It produces a fixed 128-bit digest from an input of any size, and it was built to be fast in software, which made it popular in the early 1990s before cryptanalysis caught up with it.
This article gives you five facts about MD4, explains what it is, how it works, and why it still matters.
Key takeaways
- MD4 is a 128-bit hash function designed by Ronald Rivest in 1990.
- It processes data in 512-bit blocks over three rounds of sixteen steps.
- It is the direct ancestor of MD5 and the SHA family.
- It is broken: collisions can now be found in seconds.
- It still survives inside NTLM password hashes.
What MD4 is
The first fact is that MD4 is a hash built for speed. In 1990 most hashes were slow in software, and Rivest designed MD4 around simple operations on 32-bit words, additions, rotations and bitwise functions, so that it ran quickly on the processors of the day. That speed is what made it popular, and it is also what made it fragile, because a design with so little mixing leaves room for an attacker to steer it.
The second fact is that it produces a 128-bit digest. MD4 turns any message into sixteen bytes, usually written as 32 hexadecimal characters, and the same input always produces the same digest. That fixed size was generous in 1990, when 128 bits looked like plenty, but it is small by modern standards, and it is one reason collisions became practical as computers grew faster.
The third fact is that MD4 is the ancestor of the hashes that followed. MD5 is MD4 with a fourth round and stronger mixing, and SHA-1 grew from the same family tree, which means the design choices Rivest made in MD4 shaped a decade of hash functions. Studying MD4 is therefore studying the roots of the whole family, including the weaknesses that were inherited along with the strengths.
The fourth fact is that MD4 is thoroughly broken. Hans Dobbertin found the first collisions in 1996, and by 2004 Xiaoyun Wang and her colleagues could produce a full collision in seconds on an ordinary computer. Preimage attacks have improved steadily since, which means MD4 offers no meaningful security against a determined attacker today, and no new system should use it for anything that needs trust.
The fifth fact is that MD4 refuses to die. The NT hash used by Windows NTLM authentication is simply the MD4 of the user’s password encoded in UTF-16, which means millions of systems still compute MD4 every time someone logs in. Old protocols, file-sharing networks and checksums keep it alive too, and that afterlife is why the hash still matters: you cannot secure a network until you know where its oldest cryptography hides.
Our guide to hashing explains how hash functions fingerprint data, and our guide to Tiger explains the fast hash built for 64-bit machines.
How MD4 works
Everything starts with padding, which turns the message into a whole number of 512-bit blocks. A single 1 bit is added after the message, then enough zero bits to leave room for a 64-bit length field at the end, which means the padded message always ends with its own original length, and that length field is what stops an attacker from quietly extending the message.
Each block begins with four working registers, called A, B, C and D, each holding 32 bits. The registers start from fixed constants, and the block’s sixteen message words are mixed into them over three rounds, which means the whole state is only 128 bits, and because the state is so small, every step of the mixing has to count.
The first round mixes with a simple majority function. Each of its sixteen steps takes one message word, adds it to a register together with a constant, rotates the result, and adds it into the next register, which means the message spreads through the state in order, and because the function is simple, this round is the fastest and also the weakest of the three.
The second round mixes with a different function and a different order. It uses a bitwise choice function that picks bits from one register or another, and it reads the message words in a shuffled order, which means a change in one word reaches different registers than it did in the first round, and that shuffling is what gives the design its diffusion.
The third round mixes with an exclusive-or function. It combines the registers with XOR instead of choice or majority, and it reads the message words in yet another order, which means the final round spreads the effect of every word across the whole state, and because XOR is linear, this round is the one attackers learned to exploit first.
The output stage adds the working registers back into the running digest. After the three rounds, the values of A, B, C and D are added to the four words carried over from the previous block, and that sum becomes the new running digest, which means each block builds on the last, and the final digest is the sum of every block’s work.

Comparing MD4 with other early hashes
MD4 is one of several early hash functions, and each was built with a different emphasis. MD5 is the strengthened successor with a fourth round and a 128-bit digest, SHA-1 is the larger cousin with a 160-bit digest and eighty steps, and MD4 is the fast original with three rounds and the smallest safety margin of the three, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | MD4 | MD5 | SHA-1 |
|---|---|---|---|
| Digest | 128 bits | 128 bits | 160 bits |
| Block size | 512 bits | 512 bits | 512 bits |
| Rounds | 3 rounds of 16 | 4 rounds of 16 | 80 steps |
| Year | 1990 | 1992 | 1995 |
| Best for | History lessons | Legacy checksums | Legacy systems |
The practical result is that MD4 is the right choice for history lessons, MD5 suits legacy checksums, and SHA-1 fits legacy systems instead.
Where MD4 is used
Windows authentication uses it every day. The NT hash stored by Active Directory and used in NTLM is the MD4 of the password in UTF-16 encoding, which means every NTLM login on a Windows network computes MD4, and that single legacy use is the reason the hash still runs on millions of machines.
File sharing used it to fingerprint content. The eDonkey network identified files by an MD4-based hash, and the rsync tool used MD4 in its early checksum algorithm, which means the hash once helped millions of people find and verify files, and those old fingerprints still turn up in archives today.
Teaching uses it to show how hashes break. MD4 is small enough to explain in a lecture and broken enough to demonstrate in an afternoon, which makes it a favourite example in cryptography courses that cover collision attacks and the ideas that shaped modern hash design.
Research uses it as a baseline for new attacks. When someone develops a new cryptanalysis technique, MD4 is often the first hash they test it on, because a technique that cannot break MD4 is not worth pursuing, and a platform that breaks MD4 quickly is ready for harder targets.
Standards history uses it to mark the beginning of the digest era. MD4 was the first widely used member of the MD family, and it represents the moment when hashes became a practical tool rather than a research curiosity, which means historians of the field return to it whenever they ask where modern hashing began.
Strengths and limits
The greatest strength of MD4 is its simplicity. A hash built from three rounds of plain operations is easy to implement, easy to analyse and easy to teach, and that simplicity is real, measured in the speed it achieved on 1990s hardware and confirmed by the generations of students who learned hashing from it.
It is also a strength that the design taught the field so much. Every weakness found in MD4 became a lesson for MD5, SHA-1 and SHA-2, and that legacy is worth more than the hash itself in a field where the failures of one generation are the textbooks of the next.
The limits are total, though, and the biggest is that MD4 is broken beyond repair. Collisions take seconds, preimage attacks keep improving, and the 128-bit digest is too small for modern security, which means MD4 must never be used for anything that needs trust, and systems that still rely on it should migrate away.
MD4 checklist
- Use MD4 for study and history, never for new security.
- Remember it is the ancestor of MD5 and SHA-1.
- Study its three rounds to understand early hash design.
- Compare it with MD5 to see what the fourth round added.
- Note its 128-bit digest when judging old systems.
- Test NTLM hashes carefully: they are MD4 of the password.
- Keep legacy MD4 checksums labelled as untrusted.
- Replace MD4 with SHA-256 wherever trust is needed.
- Choose SHA-256 for any system that needs real protection today.
Frequently asked questions
What is MD4 in simple terms?
It is an early hash function from 1990 that turns any message into a 128-bit fingerprint in three rounds, designed by Ronald Rivest to be fast in software.
Why is it called MD4?
After “Message Digest 4”, the fourth in Rivest’s series of message-digest designs, following MD2 and the unpublished MD3.
How is MD4 different from MD5?
MD5 adds a fourth round, strengthens the mixing functions and changes the constants, which made it harder to break, though MD5 was eventually broken too.
Is MD4 still secure?
No, collisions can be found in seconds and preimage attacks keep improving, so MD4 offers no meaningful security against a determined attacker today.
Where is MD4 used?
In Windows NTLM password hashes, in old file-sharing fingerprints, and in legacy checksums wherever the original design was never replaced.
When should I use MD4?
When you study hash history, when you teach collision attacks, or when you audit a legacy system that still computes it.
The bottom line
MD4 explained in one line is this: the fast ancestor that broke first, a three-round hash from 1990 that taught the field how to build better ones.
It is proof that speed without margin is a trap, and the reason it still matters is that every Windows login still computes it, and every hash designed since has been judged partly by the lesson MD4 taught.
This article is general information about how MD4 works, not advice about choosing encryption for a particular device or system.







