Khazad Explained: 5 Ways a Tolkien Name Guards Data

Khazad explained in plain terms means understanding a cipher named after a dwarven kingdom, a compact design from the makers of Rijndael that guards data with just eight rounds. The central question is how so few rounds can be enough, and the answer is that each round does far more work than the rounds of most ciphers.

Khazad is a block cipher designed by Paulo Barreto and Vincent Rijmen and submitted to the European NESSIE project in 2000. It encrypts 64-bit blocks with a 128-bit key, runs for 8 rounds, and it is built as a substitution-permutation network using the wide-trail strategy, the same design philosophy behind Rijndael.

This article gives you five ways Khazad guards your data, explains what it is, how it works, and where it already runs.

Key takeaways

  • Khazad is a block cipher designed by Barreto and Rijmen in 2000.
  • It encrypts 64-bit blocks with a 128-bit key over 8 rounds.
  • It uses the wide-trail strategy behind Rijndael.
  • It is named after the dwarven realm Khazad-dûm.
  • It was submitted to the European NESSIE project.

What Khazad is

Khazad is a cipher that encrypts data in 64-bit blocks using a substitution-permutation network, passing the block through layers of substitution, mixing, and key addition. Each round substitutes every byte through an S-box, mixes the bytes together with a linear transformation, and adds a round key, and the layers repeat eight times until the block has been transformed beyond recognition.

Its signature feature is the wide-trail strategy, the design philosophy that every round should spread changes as widely as possible. Khazad uses a linear transformation based on maximum distance separable codes, which means a change in one byte affects many others, and because the diffusion is so strong, the cipher needs only eight rounds where others need sixteen or thirty-two.

The design was a reaction to the needs of legacy systems. In 2000, much of the world’s data still moved in 64-bit blocks, and Barreto and Rijmen wanted a modern 64-bit cipher built with the same ideas as Rijndael, so they designed Khazad as a compact successor to the older 64-bit ciphers, with a 128-bit key for the security margin those ciphers lacked.

It became one of the best-known submissions to NESSIE, the European project that searched for new cryptographic standards after the AES contest. Khazad was not selected, but it was studied closely and praised for its elegance, and its wide-trail design influenced later ciphers that took diffusion as seriously as raw strength.

Its most famous property is the name. Khazad is named after Khazad-dûm, the dwarven realm of Tolkien’s Middle-earth, and the name fits a cipher built to guard treasures in the dark, and it has stuck through two decades of study, which is a reminder that cryptographers still enjoy a name with a story behind it.

Our guide to Blowfish explains another compact Feistel cipher from the same era, and our guide to Twofish explains the cipher that succeeded it.

How Khazad works

Everything starts with the key schedule, which expands the 128-bit master key into the round keys each round needs. The key is stretched through a series of operations that produce a different round key for every round, and the schedule is designed so that the round keys look random even when the master key is simple, which stops an attacker from working backwards from the round keys to the key.

Each round begins with substitution, passing every byte of the block through the S-box. The S-box is built from mathematical operations rather than from an arbitrary table, which means its properties can be analysed and proven, and because every byte passes through the same box, a small change in the input spreads quickly through the whole block.

The linear transformation is what makes the round work as a whole. After substitution, the bytes are mixed together with a transformation based on maximum distance separable codes, so that a change in one byte affects many others, and because the transformation is applied in every round, a single changed bit spreads across the whole block within a couple of rounds.

The key addition step mixes the round key into the state. The block is XORed with the round key, which means the key influences the data in every round, and because the round keys change from round to round, the cipher’s behaviour evolves as the rounds progress rather than repeating itself.

Decryption runs the same rounds in reverse, starting with the final round key and working backwards through the rounds. The receiver applies the inverse substitution box and the inverse transformation in the opposite order, and the plaintext comes back out, which means the same design encrypts and decrypts, even though the decryption path is a mirror image rather than a simple repeat.

The security of the design rests on the wide-trail strategy and the eight rounds. The best published attacks break only versions with fewer rounds than the real cipher uses, and the full design has survived more than twenty years of public analysis, which is why Khazad is still respected even though it was never standardised.

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 Khazad works: bytes take turns through substitution and wide mixing, eight rounds deep, until the block is transformed.

Comparing Khazad with other compact ciphers

Khazad is one of several compact ciphers built for 64-bit blocks, and each was built with a different emphasis. Rijndael is the AES standard with 128-bit blocks and a wide-trail design, Twofish is a Feistel cipher with key-dependent substitution boxes, and Khazad is the wide-trail cipher that kept the 64-bit block and the eight-round shape, while each approach trades something for something else.

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

Aspect Khazad Rijndael Twofish
Block size 64 bits 128 bits 128 bits
Key size 128 bits 128 to 256 bits 128 to 256 bits
Rounds 8 10 to 14 16
Strategy Wide trail Wide trail Feistel
Best for Legacy systems General use General software

The practical result is that Khazad is the right choice for legacy systems, Rijndael suits general use everywhere else, and Twofish fits general software instead.

Where Khazad is used

Research uses it as a case study in wide-trail design. Cryptographers still cite Khazad when they discuss how much diffusion a single round can provide, because it is the clearest example of a cipher that needed only eight rounds, and that lesson shapes how new ciphers are judged today.

Teaching uses it to show how substitution-permutation networks work. Khazad is clean enough to explain in a lecture and well documented enough to implement in an afternoon, which makes it a favourite example in cryptography courses that cover the ciphers of the NESSIE era and the design ideas that shaped them.

Benchmarks use it to measure compact designs. When someone builds a new library or a new piece of hardware, Khazad is one of the designs they test, because its eight rounds exercise different parts of a processor than heavier ciphers do, and a platform that runs Khazad well is likely to run most ciphers well.

Legacy systems use it where 64-bit blocks remain. A small number of older systems that were built around 64-bit ciphers include Khazad support, and those implementations keep running in the background of systems that were built around the NESSIE era, even though nobody chooses Khazad for a new design today.

Standards history uses it to mark the NESSIE era. Khazad was part of the European search for new standards that followed the AES contest, and it represents the compact 64-bit path that search explored, which means historians of the field return to it whenever they ask what European cryptography might have looked like.

Strengths and limits

The greatest strength of Khazad is its efficiency. A cipher that needs only eight rounds to reach full diffusion is fast in both software and hardware, and that speed is real, measured in published benchmarks and confirmed by the designers’ own analysis of the wide-trail strategy.

It is also a strength that the design is mathematically grounded. An S-box built from operations rather than from an arbitrary table can be analysed with proofs rather than with guesswork, and that grounding gives reviewers a confidence that arbitrary tables cannot, which is why the design earned respect even from its critics.

The limits are real, though, and the biggest is the 64-bit block. Short blocks mean that after enough data is encrypted with one key, patterns can start to leak, so Khazad suits legacy systems and short sessions, and a system that moves large volumes should choose a cipher with a 128-bit block instead.

Khazad checklist

  • Use Khazad for study and history, not for new systems.
  • Remember it uses only eight rounds with wide diffusion.
  • Study its layers to understand the wide-trail strategy.
  • Compare it with Rijndael to see the block-size trade-off.
  • Note its 64-bit block when planning data volumes.
  • Test against published test vectors before trusting any implementation.
  • Keep keys random and protect them as carefully as with any cipher.
  • Use a proper mode of operation, never raw block encryption.
  • Choose AES for any system that needs real protection today.

Frequently asked questions

What is Khazad in simple terms?

It is a block cipher that encrypts 64-bit blocks with a 128-bit key over 8 rounds, built as a substitution-permutation network using the wide-trail strategy behind Rijndael.

Why is it named Khazad?

After Khazad-dûm, the dwarven realm of Tolkien’s Middle-earth, a fitting name for a cipher built to guard treasures, chosen by designers who enjoyed a name with a story.

How is Khazad different from Rijndael?

Both use the wide-trail strategy, but Khazad encrypts 64-bit blocks in 8 rounds, while Rijndael encrypts 128-bit blocks in 10 to 14 rounds.

Is Khazad still secure?

No practical attack against the full 8-round cipher has been published, but its 64-bit block is short by modern standards, so it is studied as history rather than used for new systems.

What is the wide-trail strategy?

It is a design approach where every round spreads changes as widely as possible, so that few rounds are needed to reach full diffusion across the block.

When should I use Khazad?

When you study wide-trail design, when you work with legacy 64-bit systems, or when you want a cipher elegant enough to teach in a lecture.

The bottom line

Khazad explained in one line is this: the cipher that proved eight rounds could be enough, a compact wide-trail design from the makers of Rijndael that guarded data like a dwarven vault.

It is proof that diffusion can replace repetition, and the reason it still matters is that every cipher designed since has been judged partly by the lesson Khazad taught.

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

Latest articles

Scroll to Top