Cryptography Reference
In-Depth Information
the integers involved have a length of 150-4096 bits so that efficient modular com-
putations are a crucial aspect.
1.4.3 Shift Cipher (or Caesar Cipher)
We now introduce another historical cipher, the shift cipher . It is actually a special
case of the substitution cipher and has a very elegant mathematical description.
The shift cipher itself is extremely simple: We simply shift every plaintext letter
by a fixed number of positions in the alphabet. For instance, if we shift by 3 posi-
tions, A would be substituted by d , B by e , etc. The only problem arises towards
the end of the alphabet: what should we do with X, Y, Z ? As you might have
guessed, they should “wrap around”. That means X should become a , Y should be-
come b , and Z is replaced by c . Allegedly, Julius Caesar used this cipher with a
three-position shift.
The shift cipher also has an elegant description using modular arithmetic. For
the mathematical statement of the cipher, the letters of the alphabet are encoded as
numbers, as depicted in Table 1.3.
Table 1.3 Encoding of letters for the shift cipher
A B C D E F G H I J K L M
0 1 2 3 4 5 6 7 8 9 10 11 12
N O P Q R S T U V W X Y Z
13 14 15 16 17 18 19 20 21 22 23 24 25
Both the plaintext letters and the ciphertext letters are now elements of the ring
Z 26 . Also, the key, i.e., the number of shift positions, is also in
Z 26 since more than
26 shifts would not make sense (27 shifts would be the same as 1 shift, etc.). The
encryption and decryption of the shift cipher follows now as:
Definition 1.4.3 Shift Cipher
Let x , y , k
Z 26 .
Encryption :e k ( x )
x + k mod 26 .
Decryption :d k ( y )
y
k mod 26 .
Example 1.11. Let the key be k = 17, and the plaintext is:
ATTACK = x 1 , x 2 ,..., x 6 = 0 , 19 , 19 , 0 , 2 , 10 .
The ciphertext is then computed as
y 1 , y 2 ,..., y 6 = 17 , 10 , 10 , 17 , 19 , 1 = rkkrtb
Search WWH ::




Custom Search