One of the books I’m writing involves a young woman training to be a secret agent in 1803 England. The running title is either “The Art of Deception” or possibly “Pride and Extreme Prejudice.”
Spies like her would need to be versed in secret communications. Unfortunately, possession of a code machine – like Jefferson’s disks – would automatically show that she was a spy. So would possession of secret inks.
She needs a cipher, one that she could easily generate, and one where she could easily destroy the evidence. Given what was available at the time, the best idea seems to be to move the invention date of the “playfair” cipher back a few years and have her use it.
Playfair was the top British cipher for much of the 19th century, which only shows how lame were the opposition. It is one step up from mono-alphabetic encryption (the cryptograms you sometimes have in the better newspapers (although not the AJC)). It encrypts pairs of letters, but in a systematic manner. On a small enough and random enough set of messages this can be really tough to break. A not dissimilar approach occupied Alan Turing for much of 1942 and 1943 when trying to break the German Naval Enigma (they used it to encrypt the rotor settings). Long chunks of text and repeated keys are much easier.
It starts with a keyword and a square (could be a rectangle). Say “nevermore” and a 5×5 square.
Put the keyword (nevermore in this example) in the first row, dropping repeated letters. Then fill in with the rest of the alphabet. Have I and J in the same square.
Then for each pair of letters do one of three things.
- If they’re in opposite corners of a rectangle (th above) take the other corners of the rectangle th -> kq and ht -> qk.
- If they’re in the same row or column (gh above) take the letters to their right or below gh ->hi, is -> sy. Wrap around if you have to. There are alternatives here. It’s a pity they weren’t used because this is a weak point.
- If the same letter occurs twice in a row, ‘ll’ for example, encode it as lx lx.
That’s all reasonable, except the distribution of pairs of letters is not flat. ‘th’ is by far the most common pair, and much more common than ‘ht’. So given a long enough message we can count pairs and from that deduce the structure of the 5×5 square. Repeated pairs are very useful because they define relationships between infrequent letters.
One simple way to harden playfair (though not enough to make it secure by modern standards) is to make the key ‘progressive.’
And so on until the 13th iteration. After that it begins to lose too much key to be unique. (Iteration 25 would always be just the alphabet in the square.)
Other schemes would be better than this, but you get the idea.