Home › Ciphers › Double Transposition Cipher

Double Transposition Cipher

Take the columnar transposition — already respectable — and do it twice, under two different keywords. That is the whole recipe, and it carried some of the Second World War's most sensitive agent traffic: the double transposition was the hand cipher of the SOE and the OSS, the system Leo Marks fought to replace, and a cipher German analysts respected enough to attack with dedicated sections. Doing a transposition twice does not merely scramble twice as much; it destroys the statistical handholds that make a single columnar solvable, because the letters a solver wants to see side by side have been separated by two independent rearrangements. This tool applies and inverts the double system exactly, and shows you the intermediate text so you can watch the second stage do its damage.

In short

The double transposition cipher encrypts a message with the keyed columnar transposition twice: written into a grid under the first keyword and read off by columns, then the result written into a second grid under a second keyword and read off again. No letter changes — only positions — but after two independent rearrangements no original neighbours survive together. Decoding undoes the second keyword first, then the first.

The agent cipher of the SOE and OSS. Both stages here use the incomplete-column convention of this site's columnar page — the short final row is left short, never padded.

Transpose twice — and see the middle stage

21 letters
Encoded · double transposition · ZEBRA then LEMON
HATMMTPONKNTEEARAOETE

After stage one (ZEBRA alone): MHKOETANEAPTTTROMEEAN — the second keyword then transposes that.

Everything runs in your browser — nothing is uploaded.

How it works

Two grids, two orders, no survivors

Stage one encrypts the message under the first keyword exactly as the columnar tool does: the text is written row by row into a grid as wide as the keyword, and the columns are read off top to bottom in the keyword's alphabetical order, the final row left short (the incomplete-column convention — column heights are rebuilt from the message length when decoding, so nothing needs padding). Stage two takes that ciphertext as its input and encrypts it again under the second keyword — a different width, a different order.

Decoding inverts the composition in reverse: undo keyword two, then keyword one, each stage reconstructing its own column heights from its own stage's length, so the round trip is exact at every message length — a property the tests pin hard, because a double system whose stages disagree about conventions produces plausible-looking garbage instead of errors. Classical procedure adds two rules the tool states but does not enforce: the two keywords should be of different lengths (equal widths let the two grids' structures align and leak), and keys should change with every message.

Origin & history

The agents' cipher — and Leo Marks's war against it

Transposition ciphers are centuries old, and doubling them was a natural escalation long before 1939; what made double transposition famous was its adoption as the standard hand system for clandestine traffic in the Second World War, by Britain's Special Operations Executive and America's OSS among others. It earned the role honestly — against a single message it is a hard hand cipher — and German intercept services built dedicated sections against it anyway, working the system's one true weakness: messages enciphered in depth, several texts under the same keys, which can be anagrammed against each other until the grids give way.

Its wartime story is also a warning about usability as a security property. The system is clerically brutal — two grids, two keyword orders, ragged final rows, all by lamplight, often by frightened agents — and a single miscount garbles a message beyond the receiver's repair. SOE's Leo Marks spent the war fighting the consequences: agents' "indecipherables", emergency retransmissions in depth (which gifted German analysts exactly the paired traffic the system cannot survive), and finally his campaign to replace poem-based keys — verses an agent could be tortured into reciting, or an analyst could find in an anthology — with worked-out keys printed on silk. The cipher did not fail in the field; the system around it did, repeatedly.

Reference

One message, three states

PlaintextHELLOWORLD
After stage 1 (ZEBRA)ODLREOLLHW
After stage 2 (LEMON)DLOOLLEWRH

Watch the pairs. The single transposition still shows the ghost of its grid — LL survives together. After the second pass no two letters that began together remain together, which is the entire point of the system.

Worked examples

Both stages, followed through

Example 1 — HELLOWORLD under ZEBRA, then LEMON

HELLOWORLD → ODLREOLLHW → DLOOLLEWRH

The first stage is the columnar page's own pinned example. Feed its output in under LEMON — whose letters sort E, L, M, N, O, so its columns are read in the order 2, 1, 3, 5, 4 — and the second pass yields DLOOLLEWRH. The tool's stage line lets you check the middle state of any message the same way.

Example 2 — the tool's default, decoded back

MEET ME AT THE PARK AT NOON → HATMMTPONKNTEEARAOETE → (decode) MEETMEATTHEPARKATNOON

Switch the tool to Decode with the ciphertext and both keywords unchanged: it undoes LEMON first, recovering the stage-one text MHKOETANEAPTTTROMEEAN, then undoes ZEBRA. Undo them in the wrong order and you get a third, meaningless string — function composition only inverts backwards.

Breaking it

Why twice is a different animal

A single columnar leaves a solver one gift: within each ciphertext column, letters stand in their original vertical relationships, and adjacent columns in the true grid produce readable letter pairs down every row — the digram evidence anagramming climbs. Apply a second transposition and the gift is withdrawn: the first stage's columns are themselves cut into rows and re-scattered, so the pairs a solver scores are pairs of letters that met for the first time in stage one's output. The search space is no longer one order of n columns but the composition of two, and the statistical surface is far smoother.

  • Security status: the strongest classical hand transposition in general wartime use; still awkward against a lone message today.
  • What gives it away: depth — two or more messages under the same keys — or a good crib dragged through the double grid.
  • Honest limit: this site's transposition solver searches single systems only; a doubly-transposed text returns weak candidates there, and the solver says so.
Variants

The transposition family

RelativeHow it differsSolve it with
Columnar transpositionOne stage of this cipher — the building block, and the fair-fight puzzle versionThe Columnar page
MyszkowskiA single columnar whose keyword has repeated letters, read off in a merged orderThe Myszkowski page
Nihilist transpositionA columnar variant on a numbered grid, an ACA staple with its own conventionsThe Nihilist Transposition page
AMSCOColumnar over alternating digraph and single cells — structure hidden in the fill, not doubledThe AMSCO page
Uses & culture

Composition, before it had a name

Double transposition is the classical ancestor of a thoroughly modern instinct: compose two operations so their weaknesses don't align. Shannon's confusion–diffusion architecture and the product ciphers built on it are its grandchildren. In the puzzle world it marks the deep end of the transposition family — the system a setter chooses when the solving is meant to require a crib, a depth, or a team — and in the ACA catalogue it remains the benchmark hand transposition against which the single systems are measured.

Practice

Work both grids

Practice 1 — decode under ZEBRA then LEMON

NSHDPELE

Eight letters: undo LEMON first (width 5), then ZEBRA (width 5) — equal widths, against the classical advice, which is why this one is short.

Reveal the answer

SEND HELP.

Practice 2 — check the middle state

Encode HELLOWORLD with only the first keyword changed to LEMON, then ZEBRA second

Use the tool's stage line: stage one is now the LEMON pass. Compare the final text with Example 1 — order of composition matters.

Reveal the answer

The two compositions differ: keywords do not commute, and neither stage order reproduces DLOOLLEWRH.

FAQ

Frequently asked questions

Do the two keywords need to be different lengths?

By classical procedure, yes — the reasoning is structural: if both grids have the same width, stage boundaries can align in ways that leak the composition. Different widths decorrelate the stages. The tool does not enforce the rule — it is a tool, not a procedure manual — but the convention is stated here because every historical authority states it.

Why does decoding undo the second keyword first?

Because function composition inverts in reverse: the last operation applied is the first that must be removed, like unstacking plates. Undo keyword one first and you are decoding text that was never produced by keyword one alone. The tool's labels are the procedure — first keyword encrypts first.

Can the transposition solver crack a double transposition?

Not as shipped, and the solver's page does not pretend otherwise: it searches single rail fences and single columnar orders. A doubly-transposed text returns weak, incoherent candidates — itself a hint that composition is present — but the honest answer is that double systems need depth attacks or cribs, not bigger statistics.

Single or double — which should a puzzle use?

Single for a fair fight at ordinary lengths: it is solvable by the methods this site teaches. Double when the setter wants the solving to require a crib, a depth or a team — and should then provide one of those, because a lone double-transposed message with fresh keys sits near the practical edge of hand cryptanalysis by design.

Next steps