
CIS 3360 – Security in Computing
Spring 2016
Homework 1.4 (50 points)
Solution prepared by TA Mr. Hao Hu
11) [10] Using your knowledge of the Hill cipher. Encrypt the message “KNIGHT” using the
following encryption matrix (See the example of Hill cipher in Module 3 notes):
Answer: 1) Group “KNIGHT” into “KNI” and “GHT”.
2) Convert “KNI” and “GHT” into numerical equivalent, mod 26
(10
13
8) stands for “KNI”. (6
7
19) stands for “GHT”
3) Multiply the encryption key by the plaintext and reduce mod 26 to get the ciphertext
“KNI”: (5 2 12
11 9 4
8 1 22)(10
13
8)=(5∗10+2∗13+12∗8
11∗10+9∗13+4∗8
8∗10+1∗13+22∗8)=(172
259
269)=
(16
25
9) 𝑚𝑜𝑑 26. Ciphered as “QZJ”
“GHT”: (5 2 12
11 9 4
8 1 22)(6
7
19)=(5∗6+2∗7+12∗19
11∗6+9∗7+4∗19
8∗6+1∗7+22∗19)=(272
205
473)=
(12
23
5) 𝑚𝑜𝑑 26. Ciphered as “MXF”
Hence, Plaintext: “KNIGHT”. Ciphered text: “QZJMXF”.
11) [20+20] Consider the two S-boxes S1 and S2 of DES shown. Three hex digits (12 bits)
are provided to these two S boxes. The higher order six bits are fed to S1 and the lower
order six bits are fed to S2. For the six bits input to S1, the first and last bits are used to
select the row, and the middle four bits are used to select the column. Note that each S
box has four rows numbered 0, 1, 2, and 3 and sixteen columns numbered 0 to 15. So,
two bits are sufficient to select a row as 22 = 4 and four bits are sufficient to select a
column, as 24 = 16. The output from each S box is a four bit binary number, which means
that the output from each S box ranges from 0 to 15.