In: Computer Science
Encipher the following emperors’ names using a Shift Cipher with
the given key.
Solution
Step 1
Convert the letters into the numbers that matches alphabet
(A=0,B=1,C=2,D=3,E=4,….Y=24,Z=25)
Step 2
Calculate
Y=(X+K) mod 26
Step 3
Now convert the Y into letter matches
a)
Pompeii, key = D
P |
O |
M |
P |
E |
I |
I |
15 |
14 |
12 |
15 |
4 |
8 |
8 |
Now Key=D
D=3
P |
O |
M |
P |
E |
I |
I |
15 |
14 |
12 |
15 |
4 |
8 |
8 |
3 |
3 |
3 |
3 |
3 |
3 |
3 |
18 |
17 |
15 |
18 |
7 |
11 |
11 |
Step4
P |
O |
M |
P |
E |
I |
I |
|
15 |
14 |
12 |
15 |
4 |
8 |
8 |
|
3 |
3 |
3 |
3 |
3 |
3 |
3 |
|
(mod 26) |
18 |
17 |
15 |
18 |
7 |
11 |
11 |
18 |
17 |
15 |
18 |
7 |
11 |
11 |
Step 5
Now convert back to letters
P |
O |
M |
P |
E |
I |
I |
|
15 |
14 |
12 |
15 |
4 |
8 |
8 |
|
3 |
3 |
3 |
3 |
3 |
3 |
3 |
|
(mod 26) |
18 |
17 |
15 |
18 |
7 |
11 |
11 |
18 |
17 |
15 |
18 |
7 |
11 |
11 |
|
S |
R |
P |
S |
H |
K |
K |
Therefore Answer is
SRPSHKK
---
b)
Vespasian, key = P
V |
E |
S |
P |
A |
S |
I |
A |
N |
|
21 |
4 |
18 |
15 |
0 |
18 |
8 |
0 |
13 |
|
key P |
15 |
15 |
15 |
15 |
15 |
15 |
15 |
15 |
15 |
36 |
19 |
33 |
30 |
15 |
33 |
23 |
15 |
28 |
|
(mod 26) |
10 |
19 |
7 |
4 |
15 |
7 |
23 |
15 |
2 |
K |
U |
H |
E |
P |
H |
X |
P |
C |
Therefore Answer is
KUHEPHXPC
---
c)
Caligula, key = H
C |
A |
L |
I |
G |
U |
L |
A |
|
2 |
0 |
11 |
8 |
6 |
20 |
11 |
0 |
|
key H |
7 |
7 |
7 |
7 |
7 |
7 |
7 |
7 |
9 |
7 |
18 |
15 |
13 |
27 |
18 |
7 |
|
(mod 26) |
9 |
7 |
18 |
15 |
13 |
1 |
18 |
7 |
J |
H |
S |
P |
N |
B |
S |
H |
Therefore Answer is
JHSPNBSH
---
d)
Nero, key = T
N |
E |
R |
O |
|
13 |
4 |
17 |
14 |
|
key T |
19 |
19 |
19 |
19 |
32 |
23 |
36 |
33 |
|
(mod 26) |
6 |
23 |
10 |
7 |
G |
X |
K |
H |
Therefore Answer is
GXKH