COMP 165 - Fall 2016 - Homework 3

Due Wednesday, 12 October, 2016 at 11:30 PM

Report problems to ablumer via email

In this assignment you will implement a meet-in-the-middle attack on double DES. To make the space and time requirements reasonable, in addition to two (plaintext, ciphertext) pairs, I will give you most of the bits in both keys. You will need to use a data structure to store all possible (single) DES encryptions of the first plaintext so that they can be efficiently searched for matches with decryptions of the first ciphertext. The second (plaintext, ciphertext) pair is used to validate or invalidate candidate matches.

The first six bytes of the key for the first encryption are "KeyOne". You need to find the remaining two bytes, except that the low-order bit in each byte is ignored. Similarly, the first six bytes of the key for the second encryption are "KeyTwo" and you need to find the remaining two bytes.

The first (plaintext, ciphertext) pair is (in hex):

(0123456789abcdef, 561a509d28aaec69)

The second (plaintext, ciphertext) pair is (in hex):

(08192a3b4c5d6e7f, 00399c03498ddd7b)

You don't need to implement DES - you can copy an implementation from my home directory at ~ablumer/fastdes.cpp
Replace the main program with your main program and change the name to your last name.

Document your code so that it's easily understandable by the grader. Please put your first name, last name, and CS login name on the first line of your comments. Put the hex values of the four key bytes that you found on the second line.

Submit your file using this command:

provide comp165 a3 lastname.cpp