If your mission is to win a war, maintaining secrecy is mission-critical. Ancient
warrior Julius Caesar was extremely eager to disguise written messages, and
he came up with Caesar’s cipher, a simple system that is not particularly secure
once the method is known.
Here’s a slightly simplified version of how it works. Say Caesar wants to
send a written message, FIVE AM, to his generals, instructing them to attack
at that time. In the emperor’s system, each letter in the message FIVE AM is
advanced one place in the alphabet. F becomes G, I becomes J, V becomes W,
and so on. The generals receive GJWF BN, and, knowing that the procedure to
reclaim the message meaning is “subtract 1,” they convert G back to F, J to I,
and so on until the message makes sense.
To aid decoding, Caesar may have given his generals the helpful chart
shown in Figure 2-1.
To encrypt (disguise) a message, you convert each letter of the message to
the letter directly underneath it in the chart. A is converted to B and so on.
Mathematically, this method can be described as follows: message letter + 1
place = encrypted (disguised) letter. Z, the last letter, is converted to A.
A cipher is a method that encrypts or disguises text. The undisguised text is
called plaintext, and the disguised text is called ciphertext. The process of trans-
forming plaintext to ciphertext is called encryption. The reverse is called
decryption. Encipher and encrypt mean the same thing: to confuse or hide mean-
ing. Similarly, decipher and decrypt both mean to remove disguise and reclaim
meaning. See Figure 2-2 for some helpful pictures.
Figure 2-2 Encryption and decryption.
Note that even though it’s called “plaintext,” it could as well be “plain pic-
tures” or “plain audio” or “plain video.”
In Figure 2-1 we used the labels “Plain” and “Ciphered” because Caesar’s
cipher transforms a plain alphabet into a ciphered alphabet. Each letter of
ciphertext substitutes for a letter of plaintext. This is called a substitution cipher.1
Caesar’s cipher combines a method—called, in mathematics, an algorithm—
and a key. The method is “add,” and the key (how many times to do it) is 1.
Julius Caesar’s cipher was actually slightly more complex; he rotated the cipher
alphabet three places. If you understand “F + 1 = G,” it follows that “F + 2 = H”
and “F + 3 = I,” assuming that your cipher alphabet is in alphabetical order. The
F in FIVE becomes I, so FIVE AM translates to ILYH DP (see Figure 2-3).
1. Purists prefer to categorize this as a shift cipher or rotational cipher, a special kind of
substitution.
SUBSTITUTIONAND CAESAR’S CIPHER 9
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Figure 2-3 Caesar’s cipher variation: rotating each letter three places.
Advancing three letters, instead of one, shows what happens when you add
levels of complexity to a key. An adversary trying to understand your disguised
message must work a little harder to reclaim plaintext from an enciphered mes-
sage that rotates the alphabetic code by three letters (Figure 2-3) than with a
ciphered message that rotates the alphabetic code by one letter (Figure 2-1).
Julius Caesar used the ciphered alphabet in Figure 2-3. His nephew,
Augustus Caesar, said to be less able than his uncle, used the ciphered alphabet
in Figure 2-1. Figures 2-1 and 2-3 show the results of using two Caesar’s cipher
keys—1 and 3, respectively—of 25 possible keys; that is, there are 25 different
ways to disguise letters of the alphabet using a Caesar cipher method.
The concentric alphabet circles in Figure 2-4 can be used to picture any
possible key. The outer ring is fixed and does not rotate. It’s the plaintext alpha-
bet that is used to write the message. The inner, or cipher, circle is the cipher
alphabet used to create the disguised text. Each movement of the inner cipher
circle creates a new cipher alphabet. The diamond shapes in key 1 point to the
letters FIVE AM.
In Figure 2-4, one of the four keys—1, 2, 24, or 25—is displayed inside each
circle. The inner wheel rotates the “key” number of positions: 1, 2, 24, or 25.
After 25, the cipher alphabet has turned full circle and the key returns to 0. In
other words, at “key” 0 the message and ciphertext are the same—oops, not a
disguise!
The key tells how far to move the inner circle alphabet from the initial
position where the A’s in both alphabet circles match—remember, that’s key 0.
The Origin of Cipher
The Arabic sifr is the root from which we get our words cipher and
zero. After the thirteenth century, Europeans began using Arabic nu-
merals rather than Roman numerals because decimals and zeroes made
European medieval mathematicians very happy. But the concept of zero
confused common people in the Middle Ages; so when they referred
to something that wasn’t quite clear, they compared it to something
they considered a mystery: the cipher. Eventually the word cipher
evolved to describe concealment of clear meaning.
Figure 2-4 Four Caesar cipher keys—1, 2, 24, and 25—encrypting FIVE AM.
The four different cipher combinations for the plaintext message FIVE AM are
shown below each cipher circle. Because all the inner cipher circles are in alpha-
betical order, the differing ciphertext is due only to the key, which tells how many
places to rotate the cipher alphabet in relation to the message alphabet.
Tuesday, June 17, 2008
SUBSTITUTION AND CAESAR’S CIPHER
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment