YALE UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE

 CPSC 467a: Cryptography and Computer SecurityHandout #4
Professor M. J. Fischer   September 25, 2008



 

Problem Set 2

Due on Friday, October 3, 2008.

In this problem set, we consider a variant of the Caesar cipher which we call the “Happy” cipher (named after the venerable “Happy Hacker” of CPSC 223 fame). Happy (E,D) is defined as follows: Let X1 = {0,,12} and X2 = {13,,25}. Let M = C = K = X = X1 X2, and let n = |X| = 26. Define

        (
        |||{  (m + k) mod 13         if k ∈ X1 ∧ m ∈ X1
E (m ) =   m                      if k ∈ X1 ∧ m ∈ X2
 k      |||  m                      if k ∈ X2 ∧ m ∈ X1
        (  ((m + k) mod 13) + 13  if k ∈ X2 ∧ m ∈ X2

We also consider Double Happy (E2,D2). Here, K2 = K×K, and E(k1,k2)2 = Ek2(Ek1(m)).

Problem 1: Happy Encryption (5 points)

Encrypt the plaintext “i am a secret message” using Happy with key k = 3. (As usual, we will ignore spaces.)

Problem 2: Happy Decryption (5 points)

Describe the Happy decryption function Dk(c).

Problem 3: Security (10 points)

  1. Is Happy information-theoretically secure? Why or why not?
  2. Is Double Happy information-theoretically secure? Why or why not?

Problem 4: Equivalent Key Pairs (10 points)

Suppose m0 = c0 = 4.

  1. Find all key pairs (k,k) such that E(k,k)2(m0) = c0.
  2. Do all such key pairs give rise to the same function E(k,k)2? That is, if E( ˆ
k,ˆ′
k)2(m0) = E(k,k)2(m0) = c0, does E(ˆk,kˆ′)2(m) = E(k,k)2(m) for all m ∈M? Why or why not?

Problem 5: Group Property (10 points)

Is Happy a group? Why or why not?

___________________________________________________________________________________

The following problems ask you to compute probabilities. You may do so either analytically (if you’re facile with combinatorial counting techniques) or experimentally by writing a program to simulate 1000 random trials and reporting the fraction of times that the desired result is obtained. Either way, you should show your work – analytic derivation, or program and simulation results.

Problem 6: Birthday Problem (20 points)

Suppose u1,,u6 and v1,,v6 are chosen uniformly and independently at random from X (so duplicates are possible. Find the probability that {u1,,u6}∩{v1,,v6}. (Note that 6 = √ --
  n.)

Problem 7: Birthday Attack on Double Happy (40 points)

Assume Alice chooses a random key pair (k0,k0) and a random message m and computes c = E(k0,k0)2(m) using Double Happy. Eve learns the plaintext-ciphertext pair (m,c) and then carries out the Birthday Attack for m ∈M and c ∈C as follows:

  1. Find the probability that the Birthday Attack succeeds in producing a candidate key pair, and compare your result with your answer to problem 6.
  2. Find the probability that the Birthday Attack succeeds in breaking Double Happy.