MARS Explained: The IBM Cipher That Almost Became AES

MARS explained in plain terms means understanding the most complicated cipher ever to reach the final of a contest to choose a world standard, a design from IBM that mixed three different kinds of rounds into one 32-round whole. The central question is why the boldest design in the AES contest lost, and the answer is that its very boldness made it the hardest to trust, analyse, and build.

MARS is a block cipher designed at IBM and submitted to the Advanced Encryption Standard contest in 1998, where it reached the final five before losing to Rijndael. It encrypts 128-bit blocks with a 128-bit, 192-bit, or 256-bit key, runs for 32 rounds, and is built from three distinct phases that each do a different job, which is what makes it unlike any other finalist.

This article explains what MARS is, how it works, and where its ideas still turn up today.

Key takeaways

  • MARS is a block cipher designed by IBM for the AES contest.
  • It encrypts 128-bit blocks with keys of 128, 192, or 256 bits.
  • It runs for 32 rounds in three distinct phases.
  • It reached the final five of the AES contest in 1999.
  • It lost to Rijndael, which became the AES standard.

What MARS is

MARS is a cipher that encrypts data in 128-bit blocks using a heterogeneous structure, which means its 32 rounds are not all the same. The first eight rounds mix the data and the key together, the middle sixteen rounds do the heavy cryptographic work, and the last eight rounds unmix the data, and that three-part shape is the design’s defining idea.

Its signature feature is the way it mixes operations that most ciphers keep apart. MARS combines substitution boxes, modular multiplication, data-dependent rotations, and XOR in a single design, and the core rounds use an E-function that feeds data through a large substitution box and then multiplies and rotates the result, which gives each round far more mixing power than a single operation could.

The design was a reaction to IBM’s long experience with cryptography, above all the Data Encryption Standard that IBM had helped to build in the 1970s. The MARS team, led by Don Coppersmith, set out to build a cipher that resisted every attack then known, including the differential and linear attacks that had been developed since DES, and they layered defences so that breaking one layer would still leave several more standing.

It became one of the five finalists in the contest to choose the Advanced Encryption Standard, alongside Rijndael, Serpent, Twofish, and RC6. Reaching the final was itself a mark of quality, because the contest had started with fifteen submissions from around the world, and only the designs that survived two years of public cryptanalysis made it to the final round of evaluation.

Its most famous property is its sheer complexity. MARS was widely described as the hardest finalist to analyse, because its mixture of operations made it difficult to reason about the cipher as a whole, and that complexity cut both ways, since it made the cipher hard to attack but also hard for reviewers to convince themselves that nothing was hiding inside it.

Our guide to AES encryption explains the standard that MARS lost to, and our guide to Twofish explains another finalist from the same contest.

How MARS works

Everything starts with the key schedule, which expands the master key into forty 32-bit subkeys. The key is stretched and mixed through a series of operations that produce the round keys the cipher needs, and the schedule is designed so that related keys produce unrelated subkeys, which stops an attacker from learning anything useful by comparing encryptions under similar keys.

The first phase is forward mixing, eight rounds that spread the key and the data together. Each round adds a subkey, passes bytes through the substitution box, and mixes the words of the block, so that by the end of the phase every bit of the output depends on many bits of the input and the key, and the data is thoroughly tangled before the serious work begins.

The second phase is the cryptographic core, sixteen rounds built around the E-function. The E-function takes a 32-bit word, passes it through the large substitution box, multiplies the result by a subkey, and rotates it by an amount that depends on the data itself, which means the transformation changes with the data passing through it, and that data dependence is one of the strongest features of the design.

The data-dependent rotations are what make the core hard to predict. Because the rotation amount comes from the data being encrypted, an attacker cannot know in advance how far each word will turn, and that uncertainty frustrates the statistical attacks that work by tracing fixed patterns through many rounds, which is exactly the kind of attack the designers wanted to defeat.

The third phase is backwards mixing, eight rounds that undo the structure of the first phase in reverse. The backwards rounds use the same operations as the forward rounds but in the opposite order, which returns the block to a form that can be read as ciphertext, and the symmetry between the two mixing phases is part of what makes the cipher elegant despite its complexity.

Decryption runs the whole process in reverse, starting with the final subkeys and working backwards through the phases. The receiver applies the inverse of each operation 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 of encryption.

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 MARS works: three phases of mixing, sixteen rounds of heavy cryptography, and a final unmixing that seals the block.

Comparing MARS with other AES finalists

MARS is one of several AES finalists, and each was built with a different emphasis. Rijndael is the clean substitution-permutation design that won the contest, Twofish is a Feistel cipher with key-dependent substitution boxes, and MARS is the heterogeneous design that mixed more operations than any other finalist, while each approach trades something for something else.

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

Aspect MARS Rijndael Twofish
Block size 128 bits 128 bits 128 bits
Key size 128 to 256 bits 128 to 256 bits 128 to 256 bits
Rounds 32 10 to 14 16
Structure Heterogeneous Substitution-permutation Feistel
Best for Historical interest General use General software

The practical result is that MARS is the right choice for historical interest, Rijndael suits general use everywhere, and Twofish fits general software instead.

Where MARS is used

Research uses it as a case study in cipher design. Cryptographers still cite MARS when they discuss the trade-off between complexity and analysability, because it is the clearest example of a design that was strong on paper but lost trust through its own intricacy, and that lesson shapes how new ciphers are judged today.

Teaching uses it to show how the AES contest worked. Students learning about the standardisation process study the five finalists side by side, and MARS is the one that shows what happens when a design optimises for security margin above all else, which makes it a favourite example in cryptography courses and textbooks.

Benchmarks use it to measure cipher performance. When someone builds a new library or a new piece of hardware, MARS is one of the designs they test, because its mixture of operations exercises different parts of a processor than the simpler finalists do, and a platform that runs MARS well is likely to run most ciphers well.

Standards history uses it to mark the road not taken. The AES contest was a turning point for cryptography, and MARS represents the path the world did not choose, which means historians of the field return to it whenever they ask what the internet’s encryption might have looked like if a different finalist had won.

Legacy code uses it where IBM’s influence reached. A small number of older systems and libraries include MARS support because it was a finalist, and those implementations keep running in the background of systems that were built around the contest era, even though nobody chooses MARS for a new design today.

Strengths and limits

The greatest strength of MARS is its security margin. A cipher that layers substitution, multiplication, and data-dependent rotation in 32 rounds gives an attacker very little to hold on to, and the published analysis found no practical attack against the full design, which is a remarkable result for a cipher of its complexity.

It is also a strength that the design was built by one of the most experienced teams in cryptography. IBM’s cryptographers had designed DES and spent decades studying attacks, and that experience shows in a cipher that anticipates threats other designs had not yet considered, which is why reviewers respected MARS even as they declined to choose it.

The limits are real, though, and the biggest is the complexity itself. MARS is harder to implement, harder to analyse, and harder to trust than its rivals, and in a contest where confidence matters as much as strength, that complexity cost it the prize, which is a lesson every cipher designer since has taken to heart.

MARS checklist

  • Use MARS for study and history, not for new systems.
  • Remember it lost the AES contest to Rijndael in 2000.
  • Study its three phases to understand heterogeneous design.
  • Compare it with Rijndael to see the simplicity trade-off.
  • Note its 32 rounds and forty subkeys when benchmarking.
  • 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 MARS in simple terms?

It is a block cipher from IBM that encrypts 128-bit blocks in 32 rounds, built from three phases of mixing and a cryptographic core, and submitted to the contest that chose AES.

Why is MARS called heterogeneous?

Because its rounds are not all the same, with eight forward mixing rounds, sixteen core rounds, and eight backwards mixing rounds, each doing a different job.

How is MARS different from Rijndael?

Both encrypt 128-bit blocks, but MARS mixes substitution, multiplication, and data-dependent rotation across 32 varied rounds, while Rijndael repeats one clean round structure ten to fourteen times.

Why did MARS lose the AES contest?

Because reviewers found it the hardest finalist to analyse and implement, and the contest valued simplicity and confidence alongside raw security, which favoured Rijndael.

Is MARS still secure?

No practical attack against the full 32-round cipher has been published, but its complexity means it is studied as history rather than used for new systems.

When should I use MARS?

When you study cipher design, when you teach the AES contest, or when you benchmark a platform against a demanding cipher from that era.

The bottom line

MARS explained in one line is this: the boldest cipher in the AES contest, a 32-round design from IBM that was strong enough to reach the final and complex enough to lose it.

It is proof that in cryptography, being the strongest is not always enough, and the reason it still matters is that every cipher designed since has been judged partly by the lesson MARS taught.

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

Latest articles

Scroll to Top