Snefru Explained: 5 Facts About Merkle’s Pharaoh Hash

Snefru explained in plain terms means understanding the hash function Ralph Merkle named after an Egyptian pharaoh, a design from 1990 that turned a block cipher into a fingerprint machine. The central question is why a hash named after a king matters at all, and the answer is that Snefru was one of the first hashes attacked with differential cryptanalysis, and that attack changed how every hash after it was built.

Snefru is a cryptographic hash function designed by Ralph Merkle and published in 1990. It turns a message of any length into a fixed-size fingerprint of 128 or 256 bits, and it is built around a reversible function that scrambles each message block, which means the design is really a block cipher run in a hashing mode, and that structure is what made it both elegant and, as it turned out, attackable.

This article gives you five facts about Snefru, explains what it is, how it works, and why it still matters.

Key takeaways

  • Snefru is a hash function designed by Ralph Merkle in 1990.
  • It is named after the Egyptian pharaoh Snefru.
  • It offers 128-bit and 256-bit digests.
  • It was attacked with differential cryptanalysis in 1991.
  • It is used in teaching and in hash history today.

What Snefru is

The first fact is that Snefru is a hash built from a block cipher. Each message block is passed through a function that mixes it with the running state, and the output of one block becomes the input of the next, which means the fingerprint at the end is a summary of every block, and because the mixing function is reversible, the design looks more like encryption than hashing at first glance.

The second fact is that it comes in two sizes. Snefru-128 produces a 128-bit digest and Snefru-256 produces a 256-bit digest, and the larger version simply runs more passes over each block, which means the same design serves both sizes, and that shared core is what makes the two versions easy to compare.

The third fact is that it is named after a pharaoh. Merkle called his hash Snefru after the Egyptian king who built the first true pyramid, and the name was a deliberate piece of branding, which means the hash carries a story in its name, and that story is the reason it is remembered even though the design itself is long retired.

The fourth fact is that it was broken by differential cryptanalysis. In 1991 Eli Biham and Adi Shamir showed that the two-pass version of Snefru could be attacked by tracking how small input differences spread through the rounds, which means the hash became one of the first famous victims of the technique, and that attack is the reason hash designers started counting rounds far more carefully.

The fifth fact is that Snefru survived as a lesson, not a tool. Merkle answered the attack by recommending more passes, four for the 128-bit version and eight for the 256-bit version, which means the hash kept its name and its design, and that response is why Snefru is still cited whenever the history of hash cryptanalysis is told.

Our guide to SHA-3 explains the hash standard that learned from designs like Snefru, and our guide to hashing explains the fingerprint idea that Snefru is built on.

How Snefru works

Everything starts with the block, which is a 512-bit chunk of the padded message. Snefru appends padding to the message until its length fits a whole number of blocks, which means every message ends up as a neat stack of equal pieces, and because the padding includes the message length, two messages of different lengths can never be confused.

Each block begins with the chaining value, the running state carried forward from the previous block. The block is combined with that state and passed through the mixing function, which means the state after each block depends on every block before it, and because the state is the same size as the digest, the design has nowhere to hide a shortcut.

The passes are what make the design work as a whole. Each pass runs the block through the mixing function again with a different schedule, which means the same data is stirred repeatedly, and because each pass changes the order of the stirring, an attacker cannot follow a single difference through the whole computation.

The mixing function spreads the effect further. It takes 32-bit words from the block and the state, adds and rotates them, and swaps them through a fixed pattern, which means a single changed bit in the message fans out across the whole state, and because that spreading happens many times per block, the final digest depends on every input bit.

The number of passes changes the cost and the safety together. Two passes were the original design and proved too few, four passes became the recommendation for Snefru-128, and eight passes for Snefru-256, which means the user picks the balance they want, and because each pass is a full sweep of the block, the cost grows in a straight line.

The digest comes from the final state once the last block is done. After the final pass, Snefru outputs the chaining value as the fingerprint, which means the digest is simply the state after all the stirring, and that directness is what makes the design easy to describe and, as the attack showed, easy to analyse.

A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it
A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it, shows how Snefru works: message blocks take turns through pass after pass, difference after difference, until a fingerprint emerges.

Comparing Snefru with other early hashes

Snefru is one of several hashes designed around 1990, and each was built with a different emphasis. MD4 is the fast ancestor that most of them learned from, MD5 is the careful revision that became the world’s default, and Snefru is the one built from a reversible mixing function with a pharaoh’s name, while each approach trades something for something else.

The table below sets out the main contrasts between the leading approaches.

Aspect Snefru MD4 MD5
Output size 128 or 256 bits 128 bits 128 bits
Block size 512 bits 512 bits 512 bits
Passes 2, 4 or 8 3 4
Year 1990 1990 1992
Best for Hash history Speed General use

The practical result is that Snefru is the right choice for hash history, MD4 suits raw speed, and MD5 fits general use instead.

Where Snefru is used

Teaching uses it as the differential cryptanalysis example. Cryptography courses introduce Snefru when they explain how Biham and Shamir’s technique works, because it is the clearest early case of a hash falling to the method, and a student who understands Snefru understands why round counts matter.

History uses it to tell the story of 1991. The breaking of Snefru is one of the great stories of hash cryptanalysis, and the design is remembered wherever that story is told, which means it survives as history long after it stopped being a serious tool.

Research uses it as a benchmark for new attacks. When someone develops a new way to attack hashes, Snefru is often one of the designs they test, because its structure is simple enough to analyse and its history is well documented, which means the hash survives as a measuring stick.

Standards history uses it to mark the pre-SHA era. Snefru was part of the wave of designs that explored what a hash could be before the SHA family took over, and it represents the block-cipher-based path that standardisation explored, which means historians of the field return to it whenever they ask how hashes evolved.

Puzzles use it to hide messages with flair. Puzzle hunts and cryptography challenges sometimes use Snefru because its pharaoh name and its famous attack make a good story, which means the hash survives as a game, and its history is a detail puzzlers love to discover.

Strengths and limits

The greatest strength of Snefru is its clarity. A hash built from one mixing function applied again and again is easy to explain, easy to implement and easy to analyse, and that clarity is real, measured in the textbooks that still use it as an example and confirmed by the students who learn from it.

It is also a strength that the design answered its own attack honestly. When Biham and Shamir broke the two-pass version, Merkle did not hide the result but recommended more passes, and that openness is worth more than cleverness in a field where a hidden flaw is far worse than a known one.

The limits are total, though, and the biggest is that Snefru is broken in its original form. The differential attack works against the two-pass version, and the strengthened versions have never earned modern trust, which means Snefru must never be used for anything that needs secrecy, and its value today is entirely as a teacher.

Snefru checklist

  • Use Snefru for teaching and history, never for secrets.
  • Remember it was designed by Ralph Merkle in 1990.
  • Study its two sizes to understand pass-count trade-offs.
  • Compare it with MD5 to see the reversible-function approach.
  • Note Biham and Shamir broke the two-pass version in 1991.
  • Try the four-pass form to see how Merkle answered the attack.
  • Keep real secrets behind modern hashes, not Snefru.
  • Read the attack story to see cryptanalysis change a design.
  • Choose SHA-256 for any system that needs real protection today.

Frequently asked questions

What is Snefru in simple terms?

It is a hash function from 1990 that turns any message into a fingerprint of 128 or 256 bits, built by passing each message block through a reversible mixing function several times.

Why is it called Snefru?

After the Egyptian pharaoh Snefru, father of Khufu, who built the first true pyramid — Ralph Merkle chose the name as a deliberate piece of branding for his hash.

How is Snefru different from MD5?

Both are early-1990s hashes, but Snefru is built around a reversible mixing function with a variable number of passes, while MD5 uses a fixed four-round design with its own Boolean functions.

Is Snefru still secure?

No, the two-pass version was broken by differential cryptanalysis in 1991, and the strengthened versions have never earned modern trust, so it offers no security against a determined attacker today.

Where is Snefru used?

In teaching, in hash history, and in cryptanalysis research, wherever a famous broken hash is needed as an example.

When should I use Snefru?

When you teach differential cryptanalysis, when you tell the story of hash design in the early 1990s, or when you want a hash whose attack changed the field.

The bottom line

Snefru explained in one line is this: the pharaoh’s hash, a 1990 design from Ralph Merkle that proved a hash could be attacked by following tiny differences through its rounds.

It is proof that attacks make designs stronger, and the reason it still matters is that every hash designed since has been judged partly by the lesson Snefru taught.

This article is general information about how Snefru works, not advice about choosing encryption for a particular device or system.

Latest articles

Scroll to Top