Answer-Exercise 2
Answer-Exercise 2
Encrypt the message “the house is being sold tonight” using the following
ciphers. Ignore the space between words.
a. Vigenere cipher with key: "dollars"
b. Rail Fence cipher
Steps :
1. "t" becomes "w":
C= (19+03) mod 26
C = 22
2. "h" becomes "v":
C= (07+14) mod 26
C= 21
3. "e" becomes "p":
C= (04+11) mod 26
C = 15
4. "h" becomes "s":
C= (4+11) mod 26
C = 18
5. "o" becomes "o":
C= (14+00) mod 26
C = 14
6. "u" becomes "l":
C= (20+17) mod 26
C = 11
7. "s" becomes "k":
C= (18+18) mod 26
C = 10
8. "e" becomes "h":
C= (4+3) mod 26
C=7
9. "i" becomes "w":
C= (8+14) mod 26
C = 22
t...e...u...i...b...n...o...i...
.h.o.s.e.s.e.n.g.s.l.d.t.n.g.t..
..t...h...i...b...e...s...l...h.
Reading off each level, the encrypted message would be:
"teuibnoihosesengsldtngtthibeslh"
Question 2
Encrypt the message “King khalid university ” using Row Transposition Ciphers if the
key=35214
1. Write the message in rows of length equal to the key length (in this case, 5).
2. Number the columns according to the key.
3. Read off the columns in the order given by the key.
Let's encrypt your message:
35214
---------
Kingk
halid
unive
rsity
Now, we rearrange the columns in the order of the key:
21435
---------
nKkig
lhdai
iuenv
trysi
Reading off the columns in the new order, the encrypted message is:
"nlitKrhuyisndiaeguevkyi"