CubeHash Explained: 5 Facts About Bernstein’s Simple SHA-3 Entry

CubeHash explained in plain terms means understanding the hash Daniel J. Bernstein entered in the race to replace SHA-1 and SHA-2, a design from 2008 that was deliberately the simplest entry in the whole contest. The central question is why the simplest hash in a field of sixty-four entries got as far as it did, and the answer is that CubeHash trusted almost nothing but addition, rotation and exclusive-or, and that radical simplicity made it the easiest design in the contest to analyse, which is a strength in itself.

CubeHash is a cryptographic hash function designed by Daniel J. Bernstein and submitted to the NIST hash function competition in 2008. It turns a message of any length into a fixed-size fingerprint, and it is built around a giant state of 1024 bits that is stirred with a tiny round function, which means the design spends its budget on a large state rather than a clever round, and that trade is what makes it unusual.

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

Key takeaways

  • CubeHash is a hash function designed by Daniel J. Bernstein in 2008.
  • It keeps a giant 1024-bit state of thirty-two words.
  • Its round function uses only addition, rotation and xor.
  • It reached the second round of the NIST competition.
  • It is used in teaching and in hash history today.

What CubeHash is

The first fact is that CubeHash is a hash with a huge state. Most hashes of its era kept a few hundred bits of state, but CubeHash keeps 1024 bits arranged as thirty-two words, which means the design has far more room than it needs, and because the state is so large, the message is a small guest inside a very large house.

The second fact is that its round function is almost absurdly simple. Each round adds words together, rotates them, and xors them, and nothing else, which means the whole cipher is built from three operations a schoolchild could do, and because the operations are so plain, there is nowhere for a subtle flaw to hide.

The third fact is that it is tuneable. CubeHash is really a family of hashes with parameters that set how many rounds run before, during and after the message, and the best-known member is CubeHash16/32, which means the same design can be made faster or stronger by turning a few numbers, and that flexibility is why it was taken seriously from the start.

The fourth fact is that it reached the second round. CubeHash was one of fourteen designs chosen from sixty-four submissions, it was studied intensely for a year, and it was eliminated when NIST picked its five finalists, which means the simplest design in the contest still reached the last sixteen, and that result says a great deal about the value of simplicity.

The fifth fact is that it survived as a lesson, not a tool. Bernstein’s design showed that a hash could be built from almost nothing and still hold up under a year of analysis, which means CubeHash is still cited whenever the history of the SHA-3 contest is told, and that reputation is the reason it is remembered even though it never became a standard.

Our guide to SHA-3 explains the standard that won the contest CubeHash entered, and our guide to Skein explains another SHA-3 finalist built from a very different idea.

How CubeHash works

Everything starts with the state, thirty-two 32-bit words that carry the running fingerprint from one block to the next. CubeHash initialises that state with fixed constants and the requested digest size, which means the same algorithm can produce digests of different lengths, and because the initial state depends on the size, the two versions behave like different hashes from the first step.

Each block begins with the message, which is xored into the first words of the state. The block is 256 bits, a quarter of the state, which means most of the state is untouched by any single block, and because the untouched part keeps stirring, the message is mixed into a much larger pool than it could ever fill.

The rounds are what make the design work as a whole. After each block, CubeHash runs its simple round many times, adding, rotating and xoring the words in a fixed pattern, which means every block is stirred far more than once, and because the pattern is the same every time, the design is easy to describe and easy to check.

The addition spreads the effect further. Each round adds one word into another before rotating and xoring, which means a single changed bit in the message changes the sums, and because the sums feed the next round, the change fans out across the whole state within a few rounds.

The finalisation is what turns the state into a digest. After the last block, CubeHash runs its round many more times with no new message, which means the state is stirred clean of any trace of the padding, and because the finalisation runs the full round, the digest depends on the whole message and nothing else.

The digest comes from the final state, read out a word at a time. CubeHash outputs the first words of the state until it has produced as many bits as requested, which means one algorithm serves every digest size, and that shared core is what makes the variable output possible.

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 CubeHash works: message blocks take turns stirring a giant state, round after round, until a fingerprint emerges.

Comparing CubeHash with other SHA-3 candidates

CubeHash is one of several hashes that entered the SHA-3 competition, and each was built with a different emphasis. Keccak is the sponge that won the contest with a simple absorbing design, Skein is the finalist built on a tweakable block cipher, and CubeHash is the one built on a giant state with a tiny round function, while each approach trades something for something else.

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

Aspect CubeHash Keccak Skein
Construction Large state Sponge Tweakable cipher
State size 1024 bits 1600 bits 512 bits
Round function Add, rotate, xor Permutation Threefish
Contest round Round 2 Winner Finalist
Best for Hash history Standard use Research

The practical result is that CubeHash is the right choice for hash history, Keccak suits standard use everywhere else, and Skein fits research instead.

Where CubeHash is used

Teaching uses it as the simplicity example. Cryptography courses introduce CubeHash when they explain that a hash does not need a complicated round function, because it is the clearest case of a design built from almost nothing, and a student who understands CubeHash understands why analysts love simple designs.

History uses it to tell the story of 2008. The SHA-3 competition is one of the great stories of modern cryptography, and CubeHash 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 large-state designs. When someone develops a new way to analyse hashes, CubeHash is often one of the designs they test, because its huge state and tiny round make a clear target, and that clarity is the reason it is still cited.

Benchmarks use it to measure simple rounds. When someone builds a new library or a new piece of hardware, CubeHash is one of the designs they test, because its add-rotate-xor pattern exercises the most basic operations a processor has, and a platform that runs CubeHash well is likely to run most simple designs well.

Standards history uses it to mark the minimalist path. CubeHash was part of the international effort that produced the world’s hash standard, and it represents the simplest design the contest ever saw, which means historians of the field return to it whenever they ask how little a hash can be built from.

Strengths and limits

The greatest strength of CubeHash is its transparency. A hash built from three operations and a giant state is easy to explain, easy to implement and easy to analyse, and that clarity is real, measured in the speed with which analysts judged it and confirmed by the students who still learn from it.

It is also a strength that the design is tuneable. A hash whose security can be raised by turning up the round counts gives its users a dial rather than a fixed choice, and that flexibility is worth more than cleverness in a field where a design that cannot adapt is a design that ages quickly.

The limits are real, though, and the biggest is that it lost the contest. NIST chose Keccak as SHA-3, and CubeHash has never earned the deployment or the review that a standard enjoys, which means CubeHash must never be used for anything that needs real protection today, and its value is entirely as a lesson.

CubeHash checklist

  • Use CubeHash for study and history, never for new security.
  • Remember it was designed by Daniel J. Bernstein in 2008.
  • Study its 1024-bit state to understand large-state design.
  • Compare it with Keccak to see the simplicity trade-off.
  • Note it reached round two but not the final five.
  • Try its parameters to see how rounds trade against speed.
  • Keep real secrets behind standard hashes, not CubeHash.
  • Read the contest story to see how SHA-3 was chosen.
  • Choose SHA-3 for any system that needs a standard today.

Frequently asked questions

What is CubeHash in simple terms?

It is a hash function from 2008 that turns any message into a fingerprint, built around a giant 1024-bit state stirred by a round function that does nothing but add, rotate and xor.

Who designed CubeHash?

Daniel J. Bernstein, who submitted it to NIST’s SHA-3 competition in 2008 as one of sixty-four entries, and who is also known for the Salsa20 and ChaCha stream ciphers.

How is CubeHash different from Keccak?

Both entered the SHA-3 contest, but CubeHash keeps a 1024-bit state stirred by a tiny add-rotate-xor round, while Keccak is a sponge with a 1600-bit state and a wider permutation.

Is CubeHash still secure?

Yes, no practical attack against it has been published, though it lost the SHA-3 contest and has never had the review or deployment of a standard, so it is not a safe choice for new systems.

Where is CubeHash used?

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

When should I use CubeHash?

When you study large-state hash design, when you tell the story of the SHA-3 contest, or when you want a candidate that reached the second round.

The bottom line

CubeHash explained in one line is this: the simplest hash in the contest, a 2008 design from Daniel J. Bernstein that stirred a giant state with three operations and reached the second round of the race for SHA-3.

It is proof that simplicity can carry a design a long way, and the reason it still matters is that every hash designed since has been judged partly by the lesson CubeHash taught.

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

Latest articles

Scroll to Top