Beruflich Dokumente
Kultur Dokumente
The simplest code is an additive cipher. Each coded letter is simply shifted a certain number of spaces from the plain
text letter. The number of spaces the letter has been shifted is called the key. The example shown below uses a key
of 5. Using lowercase letters for plaintext (messages which are not encoded ), and capitol letters
for ciphertext (encoded text), a F, b G, etc. It is sometimes easier to do this by the number of the letter. a is
letter #1. Since 1 + 5 = 6 we want the 6th letter, F, to represent a. (Note: lowercase is used for plain text, uppercase is
used for cipher text)
less than 26, do it again. To find 75 mod 26, for example, 75 -26 = 49 which is still too big. 49 26 = 13. The 13th
letter is m.
BREAKING THE CODE
What if we find a message, but dont know the key? A little bit of statistics helps here. Table 1, at the bottom of this
page shows the relative frequencies of letters in the English language. The letter e is by far the most common. In the
encoded message above, the letter J appears 4 times, twice as much as anything else, so its a good bet that J is used
for e. Noticing that there are five spaces between e and j suggests the original key is five. We would then decipher
the message with a key of 21 (the inverse of 5) and see if it makes any sense. If not, then we go to the next most
common letter. If we guess that J were used for t, then the original key would have been 15, so we would decipher
with a key of 26 -15 = 11.
Table 1: Relative Frequencies of Letters
Letter
Freq
Letter
Freq
Letter
Freq
Letter
Freq
12.7%
6.1%
2.3%
.8%
9.1%
6.0%
2.2%
.2%
8.2%
4.3%
2.0%
.1%
7.5%
4.0%
1.9%
.1%
6.9%
2.8%
1.9%
.1%
6.7%
2.7%
1.5%
6.3%
2.4%
.9%
Additive Decryption: This message was encrypted with a key of 12. Decode it.
Cipher Text
Value
Add inverse
mod 26
Plain Text
Additive Decryption: You intercept this message from the enemy and think it uses
an additive cipher.
Cipher Text
Value
Add inverse
mod 26
Plain Text
a
1
b
2
c
3
d
4
e
5
f
6
g
7
h
8
i
9
j
k
l
m n
o
p
q
1
1
1
1
1
1
1
1
0
1
2
3
4
5
6
7
Most frequent letters: e, t, a, o, I, n, s, h, r, d, l, c, u, m, w, f, g, y, p, b, v, k, j, x, q, z
r
1
8
s
1
9
t
2
0
u
2
1
v
2
2
w
2
3
x
2
4
y
2
5
z
2
6