The Spartan scytale · 04 The maths

The scytale: the maths

The scytale as a permutation of positions, the formula that moves each letter, the number of possible keys and why letter frequencies do not change.

A permutation

The scytale does not change the letters: it changes their positions. With n rows and m columns, the letter occupying position i of the plaintext (counting from zero) lies in row r = i divided by m (integer part) and column c = i modulo m. In the ciphertext it ends up at position c × n + r.

LetterPlaintext positionRow and columnCiphertext position
A0row 0, column 00
T1row 0, column 13
K5row 1, column 14
W10row 2, column 28

How many keys?

For a message of L letters, the number of rows can range from 2 to about L divided by 2. For a 100-letter message there are fewer than 50 useful keys: a tiny number that can be tried by hand in an afternoon.

Continue with
05 Weaknesses and attacks

The scytale: weaknesses and attacks

How a scytale is broken: trying every diameter, anagramming, clues from frequencies and the physical weaknesses of the device.

↑