Вы находитесь на странице: 1из 3

Assignment 1

Security and Cryptography (IN4191)


(Total number of achievable points: 30)

Issue date: 19 September 2016; Due date: 26 September 2016, 23:59 CET (hand
in via BB)
In this assignment you are going to answer questions related to Classical Cryptosystems, Information Theory and Block Ciphers. Please briefly explain
your intuition for every solution.
This is an individual assignment. Please mention your name and student number
in submission. You have to hand in a document (PDF) with your answers and your
source code (if any) on Blackboard. You can submit an archive (ZIP, GZip, etc.)
containing both the report and the source code, but please do not submit a RAR
file.
1. Classical Cryptosystems (8 points)
(a) (2 points) In Figure 1, you see a polyalphabetic substitution cipher which performs multiple level of substitution in every encryption and decryption operation.
For example, the encryption of plaintext ONE becomes ROP.

M V H T K N L WQ A G R U S Z P X B Y O E J D I C F

decrypt

encrypt

A B C D E F G H I J K L MN O P Q R S T U VW X Y Z

U K G V P I Y C L WM T F O R N H D Z Q B E S X A J

Figure 1: Substitution Cipher


Find the decryption of the following ciphertext using the mechanism in Figure 1.
CRBZQROSPCUEPUNDRKTPF
(b) (6 points) The following ciphertexts are encrypted with the same key using Vigenere cipher. Write a program to estimate the key length of Vigenere cipher
using Kasiski test.
YVAPGCPCWHXSCJFDKHFZQITBEVYWXOFSSIPSERLHXSRCCCMMV
YCGXHJRRCXSFJRDUSFFLT
VYCDUJKFSHFOVYCBTHKTYAUFGRIIAFQLEWPCWCBQXRGMCAHD
OVLIHTCECPLMYRWIHTCTRDKZCIETIFKDCCNADVPH
Note: Please dont forget to submit your source code with your answers!

2. Information Theory (12 points)


(a) (6 points) Consider a cryptosystem where M = {m1 , m2 , m3 }, K = {K1 , K2 , K3 }
and C = {a, b, c, d}. The encryption matrix is given in Table 1.
The keys have equal probabilities and the probability distribution of M is:
P r[m1 ] = 1/6, P r[m2 ] = 1/3, P r[m3 ] = 1/2.
Table 1: Encryption Matrix
m1 m2 m3
K1 a
b
c
K2 b
c
d
K3 c
d
a
1. Compute H(M ), H(C) and H(M |C).
2. Does this cryptosystem satisfy perfect secrecy? Explain why.
(b) (6 points) The entropy of English, German and Russian language is calculated
as 1.10, 1.36 and 1.19, respectively.
1. Calculate the redundancy for every language. (RL = log2 |M | H(M ))
Note: English and German alphabet have 26 letters and Russian alphabet
has 33 letters.
2. Alice has a secret message which she wants to share with Bob. She knows
that both her and Bob can speak English, German and Russian. Furthermore, she has 3 cryptosystems to encrypt her message which are Affine
cipher, Vigenere cipher and substitution cipher.
(a) Discuss the security of her message for each possible combination of
language and cryptosystem based on unicity distance measure.
Unicity distance is computed as follows: U D = H(K)
RL
Note: You can assume that the key length of Vigenere cipher is m.
(b) Based on the values you find in (a), compare the security of Vigenere
cipher with substitution cipher. Give a minimum key length which
makes Vigenere securer than substitution.
3. Block Ciphers (10 points)
(a) (4 points) Find an implementation of DES with 56-bit effective key size and 64bit block size in your favourite programming language. Measure the time spent
for one encryption operation on your PC. Use the timing value to estimate the
total amount of time to find the encryption key using exhaustive search.
Note 1: Assume your PC operates on single core.
Note 2: To measure the encryption time accurately, take the average timing
value of several encryption operations.
(b) (6 points) A system implements AES - 128 with a modified version of CFB as
mode of operation. The decryption process for the CFB is illustrated in Figure 2.
Meanly, the plaintext P and ciphertext C are operated as 64-bit blocks. The
decryption is performed by following equations:

Page 2

X2

X1 (IV)
64-bit

64-bit

C1

64-bit

64-bit

P1

C2

64-bit

64-bit

64-bit

64-bit

64-bit


64-bit

Cj

P2

Xj+1

Xj

64-bit

64-bit

64-bit

64-bit

64-bit

Cj+1

64-bit


Pj

Pj+1

Figure 2: Decryption in CFB mode


Pj = Cj L64 (EK (Xj ))
Xj+1 = R64 (Xj )||Cj
Assume that during decryption an error occurred and Cj is received as Cj0 . Show
that the error can be recovered. Indicate the corrupted plaintext blocks (Pj s)
and Xj s.
Note 1: refers to XOR operation.
Note 2: L64 ( ) refers to left 64 bits of the corresponding block and similarly,
R64 ( ) refers to right 64 bits of the block.

Bonus
(5 points)
In Question 1(b), you estimated the key length for Vigenere cipher. As bonus challenge, we ask you to estimate the encryption key and the plaintext values for both ciphertext. You can use Index of Coincidence and Chi test which are explained in the course
book.

Page 3

Вам также может понравиться