CryptMT Explained: The Stream Cipher Built on Mersenne Twister

CryptMT explained in plain terms means understanding the stream cipher built on the most famous random number generator in computing, a design from 2005 that married the Mersenne Twister to a nonlinear filter and produced one of the fastest ciphers ever measured. The central question is why a cipher would borrow its engine from a random number generator instead of designing its own, and the answer is that the Mersenne Twister already gives a huge state and a proven long period, so the cipher only had to add the secrecy, and that shortcut is the whole point of the design.

CryptMT is a synchronous stream cipher proposed in 2005 by Makoto Matsumoto, Takuji Nishimura, Mariko Hagita and Mutsuo Saito, built by combining a large linear generator with a nonlinear filter that has memory. It turns a message into ciphertext by running the Mersenne Twister as its mother generator and passing its output through a filter based on integer multiplication, and it is built on the idea that a cipher should use the fastest parts a modern processor already offers, which means the design leans on wide registers and fast multiplication, and that pragmatism is what makes it unlike the ciphers of its era.

This article explains what CryptMT is, how it works, and where it runs in the real world.

Key takeaways

  • CryptMT is a stream cipher from 2005, submitted to eSTREAM.
  • It was designed by Matsumoto, Nishimura, Hagita and Saito.
  • It builds on the Mersenne Twister random number generator.
  • Its period is a multiple of 2 to the power 19937 minus 1.
  • It was the fastest cipher on the Core 2 Duo in benchmarks.

What CryptMT is

CryptMT is a cipher that turns a message into a keystream with two parts working together, and that pairing is what makes it unusual among stream ciphers. A huge linear generator supplies a long, well-distributed stream of words, and a nonlinear filter with memory scrambles those words into the keystream, which means the keystream comes from cooperation, and that teamwork is what lets the design stay fast while staying unpredictable.

Its signature feature is the mother generator. Most ciphers build their own state machine from scratch, but CryptMT borrows the Mersenne Twister, a generator whose mathematics was already proven, which means the cipher inherits a period and an equidistribution proof for free, and because the generator was well understood, the designers could spend their effort on the filter instead.

The design was a reaction to the speed gap in software ciphers. Processors had grown fast multipliers and wide registers, yet most ciphers still used bit-by-bit operations, so Matsumoto and his colleagues built a cipher that multiplied whole words at once, because a cipher that uses the hardware well is a cipher that runs fast, and that practicality is what made CryptMT worth submitting.

It became one of the best-known eSTREAM submissions in the world, and it is named in every history of the competition. CryptMT was one of 34 ciphers submitted to eSTREAM, it reached Phase 3 as a candidate, and it is still the first example students meet when they learn that a huge state can be a strength, which means the design survives as a lesson even though it was never selected.

Its most famous property is its speed on the processors of its day. In the eSTREAM benchmarks on an Intel Core 2 Duo, CryptMT version 3 ran at 2.95 cycles per byte, faster than HC-256, SNOW 2.0 and AES in counter mode, which means the design won the speed race outright, and because that number was measured openly, the claim has never been in doubt.

Our guide to HC-256 explains the table-based cipher it beat in those benchmarks, and our guide to Sosemanuk explains the other fast software cipher of the same eSTREAM phase.

How CryptMT works

Everything starts with the key and the initialisation vector, which seed the mother generator. CryptMT takes a key of up to 256 bits and loads it into the Mersenne Twister state, which means the starting state depends on the key, and because the state is enormous, the same key gives a keystream that will not repeat in any practical time.

Each step begins with the mother generator, which produces the next word of its sequence. The Mersenne Twister advances its huge state and outputs a 32-bit word, which means a fresh value arrives at every step, and because the generator is linear, its output is perfectly distributed but entirely predictable on its own.

The filter is what makes the design work as a whole. The generator output passes into a nonlinear filter that keeps a memory of previous words and multiplies them together, which means the value is scrambled thoroughly, and because the filter remembers what came before, the keystream depends on the whole history, not just the latest word.

The multiplication spreads the effect further. The filter uses integer multiplication, which mixes the high and low bits of its inputs together, which means a small change in the input spreads across the whole output, and because modern processors multiply in a single instruction, the scrambling costs almost nothing.

The third version is what keeps the design fast on new hardware. CryptMT version 3 replaced the mother generator with the SIMD-oriented Fast Mersenne Twister, which processes four words at once with 128-bit instructions, which means the cipher uses the processor’s widest path, and because the filter was redesigned for the same instructions, the whole cipher runs at full speed.

The keystream comes from the filter, read out as 32-bit words. CryptMT outputs the filtered words one after another, which means the keystream is a stream of 32-bit words, and that width is exactly what a fast software cipher needs for its output.

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 CryptMT works: a huge wheel of numbers feeds a filter, turn after turn, until a keystream emerges.

Comparing CryptMT with other fast ciphers

CryptMT is one of several fast software ciphers from the eSTREAM competition, and each was built with a different emphasis. HC-256 is the table-based cipher that stores its state in two large tables, SNOW 2.0 is the word-oriented cipher that became an ISO standard, and CryptMT is the one built on a famous random number generator, while each approach trades something for something else.

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

Aspect CryptMT HC-256 SNOW 2.0
Built from Mersenne Twister plus filter Two key tables LFSR plus finite state machine
Key size Up to 256 bits 256 bits 128 or 256 bits
Speed on Core 2 Duo 2.95 cycles per byte 3.42 cycles per byte 4.03 cycles per byte
Year 2005 2004 2003
Best for Teaching huge-state design Teaching table ciphers Standardised stream encryption

The practical result is that CryptMT is the right choice for teaching huge-state design, HC-256 suits teaching table ciphers, and SNOW 2.0 fits standardised stream encryption instead.

Where CryptMT is used

Teaching uses it as the huge-state example. Courses introduce CryptMT when they explain that a cipher can borrow a proven generator instead of building one, because it is the clearest case of the idea in a real design, and a student who understands CryptMT understands why a long period matters.

Research uses it as a case study in filters with memory. Cryptanalysts still cite CryptMT when they discuss how a filter can turn a predictable generator into a cipher, because it is the clearest example of the method working, and that lesson shapes how new stream ciphers are judged today.

Benchmarking uses it as a speed reference. Engineers still quote the 2.95 cycles per byte figure when they discuss how fast a software cipher can run, because it is the clearest example of multiplication-based mixing paying off, and that number shapes how new ciphers are measured.

History uses it to tell the story of eSTREAM. The competition drew 34 submissions from around the world, and CryptMT is remembered wherever that story is told, which means it survives as history as well as a working design.

Random number research uses it as the cipher cousin of the Mersenne Twister. The Twister itself is the most widely used generator in science, and CryptMT shows what happens when the same mathematics is asked to keep a secret, which means the pair is studied together whenever generators and ciphers meet.

Strengths and limits

The greatest strength of CryptMT is its speed at scale. A cipher that runs at under three cycles per byte gives programs encryption for almost nothing, and that strength is real, measured in open benchmarks on the processors of its day and confirmed by the designers who kept improving it through three versions.

It is also a strength that the design rests on proven mathematics. The Mersenne Twister brings a proven period and a proven equidistribution, and that foundation is worth more than cleverness in a field where a cipher with an unproven generator is a cipher nobody trusts.

The limits are real, though, and the biggest is the filter. The eSTREAM judges did not select CryptMT because its nonlinear filter was not as well understood as its generator, which means the cipher must never guard anything real, and a system that needs a trusted cipher must use a modern standard instead.

CryptMT checklist

  • Use CryptMT for study and history, never for new security.
  • Remember it borrows the Mersenne Twister as its engine.
  • Note its period is a multiple of 2 to the power 19937 minus 1.
  • Compare it with HC-256 to see two kinds of fast design.
  • Study the filter, which is what makes the output secret.
  • Check the version, since version 3 uses the SIMD generator.
  • Keep real secrets behind modern ciphers, not CryptMT.
  • Read the 2005 papers to see how the filter was built.
  • Choose a standard stream cipher for any message that matters.

Frequently asked questions

What is CryptMT in simple terms?

It is a 2005 stream cipher that encrypts by running the Mersenne Twister random number generator through a nonlinear filter based on multiplication.

Who designed CryptMT?

Makoto Matsumoto, Takuji Nishimura, Mariko Hagita and Mutsuo Saito, who submitted it to the eSTREAM stream cipher project in 2005.

How is CryptMT different from HC-256?

Both are fast software ciphers, but CryptMT builds on a huge linear generator while HC-256 stores its state in two large key tables.

Is CryptMT still secure?

It was not selected for the eSTREAM portfolio because its filter was not well enough understood, so it is only a subject for study and history.

Where is CryptMT used?

In teaching, in cipher research, in benchmarking, and in the history of the Mersenne Twister family.

When should I use CryptMT?

When you study huge-state ciphers, when you learn how filters work, or when you want the fastest cipher of the eSTREAM benchmarks.

The bottom line

CryptMT explained in one line is this: the borrowed-engine cipher, a 2005 design that ran the Mersenne Twister through a multiplying filter and taught the field that speed and understanding must arrive together.

It is proof that a proven generator is only half a cipher, and the reason it still matters is that every fast cipher designed since has been judged partly by the lesson CryptMT taught.

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

Latest articles

Scroll to Top