homeworks Solutions to Homework 3
"The HALL of FAME"

Problem 4  (Part B) was solved by:
Uri Barenholz, Roman Dovgard, Omer Holz, Leonid Karlinski, Emmanuel Lanzmann, Itsik Mantin, Yaniv Meoded, Eran Ofek, Eduard Oks.

This was a "relax" homework with an exception of problem 4 (iterative cryptosystems) and 5 (grandpre, hill climbing contest which nobody has solved so far). The average grade was 85. Below are several best solutions.  Again, some people submitted excellent works by e-mail or in hand writing, so they can't be shown here.


Brief Comments

1. Optimal Trial and Error
  A famous problem and a good training for cryptanalyst.

It is interesting to show that for 14 coins 3 weighings are not enough, although information theoretically it is not obvious. See Paul Koning's work for detailed analysis.

2. Unicity Distance
A. one can use D = R - R1 = 2.7 since transposition cipher preserves letter frequencies.

The aim of this exercise was to give some crude estimates for the Grandpre contest. However, not much can be done in the cases B, C except to apply random cipher formula. Nobody knows how estimate UD even for simple substitution case. Friedman's claimed 25 letters is hard to believe (without spaces), and Grandpre is not even a pure cipher.

B. The answer is:  410/3.2 ~ 128
C. The answer is:   381/3.2~119
this is clearly misleading, since UD in the second case must be larger and not smaller. Interesting analysis is given in Paul Koning's work.

3. Pure Ciphers
a) Pure; residue class is exactly as in a simple substitution cipher
(T^{-1}_j T_k is a simple substitution).

b) Not pure (one of possible counterexamples):

T_k:        AA BB -> GXGX XGXG->GXGXGXGX
T^{-1}_j: GXGXGXGX ->GXGXGXGX -> CCCC
T_i:        CCCC -> AAAAAAAA -> AAAAAAAA
no T_l can transform AABB into AAAAAAAA

c) Not pure (one of the possible counterexamples):

T_k:     A -> 12, B-> 40;  AB -> 12 40
T^{-1}_j: 12,40 -> C;   12 40 -> C C
T_i:     C -> 11; C C -> 11 11
no T_l  can transform AB into 11 11.

4. Iterative ciphers
A. Playfair
Seven queries in adaptive chosen plaintext attack (i.e. our next query depends on the results of the previous queries) are enough if Playfair matrix is random. Less if it is built with a keyword.

You are welcome to prove the opposite (there  are 12 errors in the 37-letter text below): Testlitesolanyqrhoroismtitlhirmtobead.
Note that iterating our cipher 5 times gives cleartext.
 

4B. Generic
338 queries, 338 steps to recover full S-box. This is about 4.7 times more than UD of this cipher.

Here we assumed that the number of cycles is small, which is plausible since the variance of the number of cycles is about ln(n)~6.5 (see here). However the rare case of many small cycles quickly comes out of control. So here is another method to attack the problem:

Slide Attacks

Suppose that we know the outcome of a single round (TS(P))  for a certain plaintext P. Consider a pair of plaintexts P and P'=TS(P). Denoteby C and C' their corresponding ciphertexts. Since all rounds perform the same function, the two encryptions will produce the same results with a slide by one round. Note that the ciphertext of the first encryption is just the input to the fourth round in the second encryption. Since ciphertexts are known we receive an equation C' = TS(C). This gives us 8 entries in the S table. Few slid queries will provide us with necessary cycle binding information.

So the attack will be as follows:

Refinements are possible (even a short odd cycle is sufficient to start the second (sliding) phase of the attack).

Other Attacks
This cipher allows many efficient attacks. One can consider:

5. Grandpre

While many solved the second test grandpre, nobody has solved the 1st test and the contest problems. You are welcome to try, the stakes are increased.

Here is the program for testing the grandpre matrix written by
Dani Halevi and Raanan Wald.



Last modified on 12.06.2000.