Decrypting the Two-Time Pad (ITA Archived Puzzle, Analyzed)

Post written by Deepak Surti

Posted: 07-May-2011

Contents

1 Problem Statement

Please refer to the decrypting the two time pad problem on this page.

2 Analysis

The following are the problem characteristics. It is an instance of:

  • Caesar shifts. However it is not a case of monoalphabetic substitution. It is a case of polyalphabetic substitution.
  • It will be a good idea to simply add the two ciphers and consider it as a single cipher.
  • We can use a sufficiently large reference text (from Project Gutenberg) as a reference to identify the decoded symbols.
  • We have to decode upto a point where it is not hard for a human reader to detect the actual text. We can make use of Lisp restarts , to the user, to stop or continue the decoding process.

This is a possible algorithm.

3 Algorithm

  1. Build a table of symbols for the chosen reference text which stores a symbol and its frequency within the reference text. The reference table can contain symbols consisting of 1 to 3 (or may be 4) characters. Next build a single cipher from the two ciphers. Build a table for the cipher again containing symbols and its frequency.
  2. Now match the symbol in the cipher with the maximum frequency with a corresponding symbol of maximum frequency in the reference table. The actual frequency count does not matter.
  3. Now susbsitute these reference symbols in the cipher and do pattern matching,which will be a case of approximate string matching, to identify possible matches in the cipher. Provide the possible matches to the user as a restart. With the chosen match, update the table with the symbol mapping and restart the same process of symbol matching till the user chooses to stop.

4 Implementation

I have not implemented this algorithm. But the analysis and the requirements of the problem do indicate that an approximate solution is requi Ared and the quality of it will hence depend upon (drawn from the algorithm) the chosen reference text. As such we may have to try out the implementation with mulitple chosen texts.

5 Reference Algorithms