Grille Cipher Tool

Type up to 16 characters to encrypt them with a 4×4 turning grille.

How it is calculated

This is a fixed 4×4 turning grille, with no key to enter. The text is cleaned first: spaces are removed, letters are made lower case and everything except a–z and 0–9 is dropped, so punctuation and accented letters such as ç or ğ disappear. The result is cut to 16 characters, or padded with X up to 16. The grille has four holes, at row 1 column 1, row 1 column 2, row 1 column 3 and row 2 column 2 (counting from 1). The first four characters are written into those holes; the grille is then turned 90° clockwise and the next four are written, and so on for four turns, so that every one of the 16 cells is filled once. The ciphertext is the grid read row by row in capitals. The grid is also shown. There is no decrypt mode, and because the hole pattern is the same for everyone, this is a demonstration of the method and not secure encryption.

Worked example

Enter Attack at dawn!. Cleaned and padded to 16 characters it becomes ATTACKATDAWNXXXX. Turn 1 writes ATTA into the four holes. Turn 2, after rotating the grille 90°, writes CKAT. Turn 3 writes DAWN and turn 4 writes XXXX into the remaining cells. Reading the filled grid row by row gives the grid ATTC, XATK, XXNA, XWAD, so the ciphertext is ATTCXATKXXNAXWAD. The exclamation mark was dropped and the four X letters at the end are padding, not part of the message.

Try this example →

Common mistakes

  • Typing more than 16 letters and digits. Everything after the 16th character is silently cut off, so a long message loses its end.
  • Expecting punctuation, spaces or accented letters to be kept. They are removed, so "café" is encrypted as caf, and the receiver gets no spaces to split words.
  • Forgetting the padding. A short message gets X letters at the end, and the person decoding must know that those X letters are filler.
  • Using the output as real protection for a secret. The grille is fixed and the same text always gives the same result, so anyone with the tool can reproduce the permutation.
  • Looking for a decrypt option. The tool only encrypts; to read a message you must reverse the same fixed order by hand.

About this calculator

A turning grille (often called a Cardan grille after 16th-century Italian polymath Girolamo Cardano, whose original hole-cut card was a fixed, non-rotating mask; the rotating version is usually credited to Eduard Fleissner) is a transposition cipher that uses a physical card with cut-out holes. In the 4×4 turning-grille variant, a quarter of the 16 cells are cut open; the grille is laid over a blank grid, letters are written through the holes, then the grille is turned 90° three more times (four positions in all), filling all 16 cells in a scrambled but reversible order to produce the ciphertext.

Because the grille itself — not a mathematical key — determines the permutation, decrypting the message requires physically possessing (or precisely reconstructing) the same grille and rotation sequence, making it historically popular for hand-delivered military and diplomatic messages before modern cryptography. Cryptography students, puzzle and escape-room designers, and history-of-cryptography enthusiasts use this calculator to encode short messages exactly the way a hand-cut turning grille works, without cutting a physical card.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators