Home › Ciphers › Turning Grille Cipher

Turning Grille Cipher

The turning grille — the Fleissner grille — is a sheet of cardboard with holes punched in it, laid over a blank grid. You write your message through the holes, turn the sheet a quarter-turn, write the next letters through the same holes into fresh cells, and repeat until four passes have filled the square; the filled grid, read off in rows, is the ciphertext. The holes must be placed so that the four rotations never overlap — the orbit rule — and the designer below enforces it live: click any cell to move a hole there, and watch the grille stay valid. A worked 6×6 example is loaded, and a small 4×4 case is computed by hand on this page so the mechanism can be checked without trusting any code.

In short

A turning grille is a physical transposition key: a square mask whose holes — exactly one in each set of four cells that rotate into one another — expose every cell of the grid exactly once across four quarter-turns. Writing through it scrambles letter positions; reading a filled grid back through the same grille, in the same four passes, restores the message.

The Fleissner grille, after Eduard Fleissner's 1881 handbook; popularised by Jules Verne's Mathias Sandorf (1885).

Design the grille, then run it — a worked example is loaded

35 letters

The grille — filled cells are holes. Click a cell to move its orbit's hole there; the four rotations of a hole are shown locked.

Encoded · Turning grille · 6×6
TTDEGGHERSSEIRTWTEISLULRLLNEIELXHNIT

Holes at (1,1) (2,6) (6,4) (4,6) (2,1) (5,5) (3,5) (5,3) (4,4) — rows and columns counted from 1 · 1 X padded the block

Everything runs in your browser — nothing is uploaded.

How it works

Four passes, one sheet

Lay the grille over an empty N×N grid. Through the holes, write the first letters of the message, reading the exposed cells in normal reading order (rows, left to right). Rotate the grille 90° clockwise and write the next letters through the holes — which now expose a fresh set of cells. Rotate twice more. After four passes every cell holds exactly one letter, if the holes were placed by the orbit rule: the cells of the grid fall into families of four that rotate into one another (the centre cell of an odd grid rotates into itself and can never be used, which is why grilles are even-sized), and a valid grille has exactly one hole in each family. A 6×6 grid has nine families, so nine holes and thirty-six letters per block. Decoding reverses the ritual: fill the grid from the ciphertext in reading order, lay the grille over it, and read the letters through the holes pass by pass.

The designer above makes the rule tangible: the cells shown locked are the rotations of the holes already placed — click one of them and the hole moves there instead, because two holes in one family would expose the same cell twice and leave another cell forever covered. Messages longer than one block are written block by block under the same grille; a short final block is padded with X, and the padding is visible in the output, as with every honest hand system.

Origin & history

Cardboard cryptography

Stencils for secret writing are older than the turning grille — Cardano described a fixed grille in the sixteenth century — but the rotating form is Eduard Fleissner's: his Handbuch der Kryptographie of 1881 set out the turning grille with the orbit construction. Three years later Jules Verne built the plot of Mathias Sandorf (1885) around one, and the device entered popular imagination permanently — a grille is the rare cipher a novel can show the reader. The First World War, which industrialised transposition, largely passed it by: cutting accurate grilles was fiddly, a captured grille compromised everything written under it, and the German army's actual field systems (the ADFGX family) chose fractionation instead. The ACA keeps turning grilles as a constructor's type, where the design problem — place the holes well — is half the puzzle.

Reference

A 4×4 grille, computed by hand

The grille (● = hole)● · · · / · ● · ● / · · · · / · ● · ·
Holes(row 1, col 1), (2, 2), (2, 4), (4, 2) — one in each of the four orbits
Pass 1 writesA at (1,1), B at (2,2), C at (2,4), D at (4,2)
Pass 2 (turn 90°)E at (1,2), F at (2,1), G at (3,2), H at (4,4)
Pass 3 (turn 180°)I at (1,4), J at (3,3), K at (3,1), L at (4,3)
Pass 4 (turn 270°)M at (1,3), N at (3,4), O at (4,1), P at (2,3)
Filled grid, read in rowsAMIE FBGC JNKO PDHL

Check it by hand: the message ABCDEFGHIJKLMNOP goes in four letters at a time, and the sixteen placements above account for every cell exactly once — the orbit rule doing its work. The ciphertext AMIEFBGCJNKOPDHL is scrambled only in position: same letters, new addresses, which is the definition of transposition. Load the 4×4 size in the tool and click these very holes to watch the designer agree.

Worked examples

The loaded 6×6, and the hand case

Example 1 — the loaded grille: a full 6×6 block

THE TURNING GRILLE HIDES ITS LETTERS WELL → TTDEGGHERSSEIRTWTEISLULRLLNEIELXHNIT

Run live above. Thirty-five letters plus one X pad fill the block; the nine holes listed under the designer are spread across the grid's nine orbits. Decode the output with the same grille and the sentence returns, pad and all. Move any hole in the designer and the ciphertext changes completely while the letter multiset stays identical — transposition's signature.

Example 2 — the hand-computed 4×4

ABCDEFGHIJKLMNOP → AMIEFBGCJNKOPDHL

The Reference section's case: the dullest possible message (the alphabet, minus the letters a 4×4 cannot hold) chosen precisely so that every placement can be checked by eye. Any grille tool that cannot reproduce this grid has its rotation order or its reading order wrong; this one is pinned to it in the build suite.

Breaking it

Solving a grille

A grille ciphertext preserves the plaintext's letters exactly, so frequency counts identify the language at once; the puzzle is positional. The structural tells: the block length is a perfect square (16, 36, 64), and the four-pass construction constrains which positions can hold consecutive plaintext letters — in each pass, consecutive letters land only in cells related by the grille's geometry. Solvers attack with anagramming within those constraints, or hill-climb candidate hole sets scored by the digraphs the four passes produce. Multiple blocks under one grille are the real gift: the same position permutation applies to every block, multiplying the material exactly as it does for columnar transposition.

  • Security status: a historical device and constructor's puzzle — position-only scrambling falls to anagramming.
  • What gives it away: square block lengths and a perfect plaintext letter-frequency profile.
  • The working order: identify the block size, then anagram within the four-pass constraints or climb the hole set.
Variants

Grilles and other transpositions

RelativeHow it differsSolve it with
Route cipherNo mask at all: the grid is filled one way and read off along a stated routeThe Route Cipher page
ScytaleThe antique original: a strip wound on a rod, the grid wrapped into a cylinderThe Scytale page
Rail fenceThe grid degenerates to zigzag rails — transposition at its simplestThe Rail Fence page
Columnar transpositionThe grid's columns are reordered by a keyword rather than exposed by a maskThe Columnar Transposition page

The grille's nearest relative in spirit is the fixed Cardano grille — same stencil idea, no rotation, the message hidden among decoy letters rather than scrambled. Fleissner's rotation is what turns a concealment device into a true transposition cipher: nothing is hidden, everything is moved.

Uses & culture

Verne's plot device

No other classical cipher has the grille's literary footprint: Verne's conspirators in Mathias Sandorf write with one, the intercepted grille message drives the plot, and generations of readers met transposition first as a piece of pierced cardboard. The device still appears wherever cryptography is taught with hands rather than screens — it is the one cipher whose key you can cut with scissors — and in puzzle hunts that want a physical prop. The designer above is the modern form of the same pleasure: half the puzzle was always placing the holes.

Practice

Place the holes

Practice 1 — which cells fight over one hole?

On a 4×4 grille, a hole is placed at row 1, column 2. Which three other cells can no longer hold a hole?

Rotate the cell in your head: a quarter-turn sends (row r, column c) to (c, 5 − r) on a 4×4.

Reveal the answer

(2, 4), (4, 3) and (3, 1) — the orbit of (1, 2) under the four rotations. Exactly one of the four may be a hole; the designer shows the other three locked the moment you place it, and clicking a locked cell moves the hole there instead of adding a forbidden second one.

Practice 2 — decode the hand case

AMIEFBGCJNKOPDHL, under the Reference grille → ?

Fill the 4×4 grid from the ciphertext in reading order, then read through the holes in the four passes.

Reveal the answer

ABCDEFGHIJKLMNOP — pass 1 reads (1,1) A, (2,2) B, (2,4) C, (4,2) D from the filled grid; the rotations continue E–H, I–L, M–P. Set the tool to 4×4, click the Reference holes, switch to Decode and check.

FAQ

Frequently asked questions

Why must the grid be even-sized?

Because of the centre. In an odd-sized grid the centre cell rotates into itself — its orbit has one cell, not four — so no hole placement can expose it exactly once across the four passes: it would be written four times or never. Even grids (4, 6, 8, 10…) divide cleanly into four-cell orbits, which is why historical grilles and this tool use them.

Why does clicking a locked cell move the hole instead of refusing?

Because that is the design gesture users actually want: the orbit already has its hole, and clicking another cell of the same orbit means "put it here instead." Refusing would force a delete-then-place dance for every adjustment. The rule itself is never relaxed — two holes in one orbit would expose a cell twice and strand another, and the tool makes that state impossible to reach.

Does the rotation direction matter?

Yes — clockwise versus counter-clockwise gives different grilles from the same hole set, and a message written under one will not read under the other. This tool rotates clockwise, the common convention; the hand-worked 4×4 in the Reference section lets you verify the direction against any source you trust.

How big were historical grilles?

Verne's fictional one and Fleissner's examples were modest — the labour of writing through cardboard grows with the square, and a 10×10 grille means 100 letters per block with 25 holes to place by the orbit rule. The tool offers 4×4, 6×6 and 8×8, which cover the sizes a reader is ever likely to meet in print.

Next steps