Transposition cipher breaker

Tries every rail fence and every columnar transposition order up to 8 columns (hill climbing beyond) and ranks them by English fitness.

How it works

A transposition cipher keeps the letters and changes their order. Its fingerprint is clear: the letter counts are exactly those of English (low $\chi^2$, IC about $0.066$), but the text does not read. The quadgram fitness, which looks at the order of the letters, is the right score to unscramble it.

In a rail fence the text is written in a zigzag over $r$ rails and the rails are read one after another; with all rail counts and starting offsets there are only a few hundred settings. In a columnar transposition the text is written in rows under a key of $k$ columns and the columns are read in the key’s order. Up to 8 columns all $k!$ orders are scored ($8! = 40\,320$); above that the breaker swaps and moves columns while the fitness improves.

Only the letters are used: spaces and punctuation are removed first, as most transposition ciphertexts are written. The key is shown as the number above each column, 1 for the column read first.

Everything is calculated in your browser. Nothing you type leaves your device.