Wednesday, September 15, 2004
- Caesar's cipher
- The Spartan skytale
- Polybius' square
Suetonius describes Julius Caesar's simple cipher in his Life of Julius Caesar 56 (tr. J. C. Rolfe):
There are also letters of his to Cicero, as well as to his intimates on private affairs, and in the latter, if he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others.Here's how Caesar's cipher works with our modern alphabet:
extant et ad Ciceronem, item ad familiares domesticis de rebus, in quibus, si qua occultius perferenda erant, per notas scripsit, id est sic structo litterarum ordine, ut nullum verbum effici posset: quae si qui investigare et persequi velit, quartam elementorum litteram, id est D pro A et perinde reliquas commutet.
If you want to encrypt a message, you substitute the letters in the bottom row for the ones in the top row (D for A, E for B, etc.), and when you want to decrypt a message, you substitute the letters in the top row for those in the bottom row (A for D, B for E, etc.). MIKE encoded would be PLNH.
Aulus Gellius (17.9.1-5) gives some further details:
There are books of epistles of Gaius Caesar to Gaius Oppius and Balbus Cornelius, who administered Caesar's affairs in his absence. In some passages in these epistles are found single letters of the alphabet not joined together into syllables, letters which you might suppose were arranged randomly; for no words can be formed from these letters. However there was a secret agreement among these men concerning a change in the placement of letters of the alphabet, in such a way that one letter took the place and name of another in what was written, but in reading each position and meaning was restored; which letter was written for which was agreed upon ahead of time among those who devised this cipher. There is even a rather ingeniously written treatise by the grammarian Probus concerning the secret meaning of letters in the composition of Caesar's epistles.Caesar's successor Augustus used a similar cipher, according to Suetonius, Life of Augustus 88 (tr. J.C. Rolfe):
libri sunt epistularum C. Caesaris ad C. Oppium et Balbum Cornelium, qui res eius absentis curabant. in his epistulis quibusdam in locis inveniuntur litterae singulariae sine coagmentis syllabarum, quas tu putes positas incondite; nam verba ex his litteris confici nulla possunt. erat autem conventum inter eos clandestinum de commutando situ litterarum, ut in scripto quidem alia aliae locum et nomen teneret, sed in legendo locus cuique suus et potestas restitueretur; quaenam vero littera pro qua scriberetur, ante is, sicuti dixi, conplacebat, qui hanc scribendi latebram parabant. est adeo Probi grammatici commentarius satis curiose factus de occulta litterarum significatione in epistularum C. Caesaris scriptura.
Whenever he wrote in cipher, he wrote B for A, C for B, and the rest of the letters on the same principle, using AA for X.
quotiens autem per notas scribit, B pro A, C pro B ac deinceps eadem ratione sequentis litteras ponit; pro X autem duplex A.
The Spartans had a clever method of secret writing known as a skytale. Plutarch gives a clear description of it in his Life of Lysander 19.4-7 (tr. John Dryden):
When the Ephors send an admiral or general on his way, they take two round pieces of wood, both exactly of a length and thickness, and cut even to one another; they keep one themselves, and the other they give to the person they send forth; and these pieces of wood they call Scytales. When, therefore, they have occasion to communicate any secret or important matter, making a scroll of parchment long and narrow like a leathern thong, they roll it about their own staff of wood, leaving no space void between, but covering the surface of the staff with the scroll all over. When they have done this, they write what they please on the scroll, as it is wrapped about the staff; and when they have written, they take off the scroll, and send it to the general without the wood. He, when he has received it, can read nothing of the writing, because the words and letters are not connected, but all broken up; but taking his own staff, he winds the slip of the scroll about it, so that this folding, restoring all the parts into the same order that they were in before, and putting what comes first into connection with what follows, brings the whole consecutive contents to view round the outside.Aulus Gellius also describes the skytale at 17.9.6-15, but he adds nothing new, so there is no point in translating or transcribing his description. He uses the Latin word surculus (shoot, branch) for the Greek skytale. Thucydides (1.131.1, talking about the Spartan Pausanias, who was a contemporary of Themistocles) mentions the skytale in passing, so we know that it was in use as early as the 480s B.C.
Polybius' square or checkerboard is actually a cryptographic modification of a semaphore signalling system. Since Polybius' description is somewhat convoluted, it's advantageous to look at the adaptation before the original. In the following square we use our modern alphabet and combine I and J. In a similar scheme, we could add the 10 digits and use a 6 by 6 square. Polybius had one slot left over, since the Greek alphabet has only 24 letters.
If we want to encrypt a word, we select its coordinates in the square. For example, MIKE becomes 32 24 25 15. One advantage of this cipher is that it uses only 5 different symbols (in pairs) to encode 25 characters. Prisoners have sometimes used the Polybius square to communicate by knocking on walls.
Now Polybius' description of his semaphore system of signalling by fire (10.45.6-10.47.1, tr. W.R. Paton) might be easier to understand:
The most recent method, devised by Cleoxenus and Democleitus and perfected by myself, is quite definite and capable of dispatching with accuracy every kind of urgent messages, but in practice it requires care and exact attention. It is as follows: We take the alphabet and divide it into five parts, each consisting of five letters. There is one letter less in the last division, but this makes no practical difference. Each of the two parties who are about signal to each other must now get ready five tablets and write one division of the alphabet on each tablet, and then come to an agreement that the man who is going to signal is in the first place to raise two torches and wait until the other replies by doing the same. This is for the purpose of conveying to each other that they are both at attention. These torches having been lowered the dispatcher of the message will now raise the first set of torches on the left side indicating which tablet is to be consulted, i.e. one torch if it is the first, two if it is the second, and so on. Next he will raise the second set on the right on the same principle to indicate what letter of the tablet the receiver should write down.
Upon their separating after coming to this understanding each of them must first have on the spot a telescope with two tubes, so that with the one he can observe the space on the right of the man who is going to signal back and with the other that on the left. The tablets must be set straight up in order next the telescope, and there must be a screen before both spaces, as well the right as the left, ten feet in length and of the height of a man so that by this means the torches may be seen distinctly when raised and disappear when lowered. When all has been thus got ready on both sides, if the signaller wants to convey, for instance, that about a hundred of the soldiers have deserted to the enemy, he must first of all choose words which will convey what he means in the smallest number of letters, e.g. instead of the above "Cretans a hundred deserted us," for thus the letters are less than one half in number, but the same sense is conveyed. Having jotted this down on a writing-tablet he will communicate it by the torches as follows: The first letter is kappa. This being in the second division is on tablet number two, and, therefore, he must raise two torches on the left, so that the receiver may know that he had to consult the second tablet. He will now raise five torches on the right, to indicate that it is kappa, this being the fifth letter in the second division, and the receiver of the signal will note this down on his writing tablet. The dispatcher will then raise four torches on the left as rho belongs to the fourth division, and then two on the right, rho being the second letter in this division. The receiver writes down rho and so forth. This device enables any news to be definitely conveyed.
Many torches, of course, are required, as the signal for each letter is a double one.
These techniques of secret writing are of course rudimentary compared to the sophisticated methods in use today, but they nonetheless cast an interesting light on the ancient Greeks and Romans.