MATH 3CY3, ASSIGNMENT # 1,SOLUTIONS Question 1: Alice uses

MATH 3CY3, ASSIGNMENT # 1,SOLUTIONS
Question 1: Alice uses the following affine cipher to send messages to Bob:
x 7→ 21x + 7.
a) Encrypt the following message: comenow
b) 10 minutes later Bob receives the encrypted message UPEHQNA from Alice. What
was Alice’ message this time?
Solution:
a) comenow ←→ 2 14 12 4 13 14 22
This is mapped to 23 15 25 13 20 14 1 ←→ XPZNUPB
b) UPEHQNA ←→ 20 15 4 7 16 13 0
To decrypt we have to invert 21 mod 26. The inverse is 5, so that the decryption key is
y 7→ 5(y − 7).
This gives the original message nolater.
Question 2: Suppose Eve knows that the plaintext is aaaaaaaa and Eve has intercepted the ciphertext. For each of the following cipher systems state whether or not Eve
can determine the key. Justify your answer.
(a) shift cipher
(b) affine cipher
(c) Hill cipher with a 2 × 2-matrix.
Solution:
(a) If x 7→ x + k is the shift cipher, then 0 7→ 0 + k = y, so k = y can be computed.
(b) If x 7→ αx + k, then a 7→ 0 + k = y. This does determinek, but not α.
(c) If the Hill cipher is given by the matrix
b c
,
d e
Typeset by AMS-TEX
1
2
then the vector (0, 0) is mapped to (0, 0), hence does not give any information at all.
Question 3: Eve tries a chosen plaintext attack on a Hill cipher with a 2 × 2-matrix
A. She finds that ba encrypts to HC and zz encrypts to GT. Determine A.
Solution: The given information is (1, 0)A = (7, 2) and (25, 25)A = (6, 19) and can be
combined to yield
1
0
7 2
·A=
.
25 25
6 19
Let
C=
1
25
0
25
≡
1
−1
0
−1
mod 26.
To obtain A we have to try to invert C modulo 26. This is possible, since the determinant
of C is −1 mod 26.
We obtain
1
0
−1
C ≡
mod 26.
−1 −1
Now
A=C
−1
·
7
6
2
19
≡
7 2
13 5
mod 26.
Question 4: Smarty uses the matrix
9
7
5
3
for his Hill cipher. Find two different vectors, whose encryptions are the same.
Solution:
Question 5: Alice sends her opinion about the course 3CY3 to Bob using a Hill cipher
with matrix


3 0 0
A = 2 1 0.
1 2 1
Bob receives the ciphertext GGDCCUNAE. What was the message?
Solution:
Info: Late assignments will not be accepted.