Wednesday, May 29, 2013

D'Agapeyeff cipher continues to thwart me

Banging one's head against the wall probably isn't the way most people would choose to spend their free time. But here I am again, giving the D'Agapeyeff cipher another go-round.

This time I took a slightly different path, but revisited used the same ground rules:
  1. Remove the 6s, 7s, 8s, 9s, and 0s.
  2. Assume a 14x14 square was used for diffusion

From there, you can assume there are only 48 possible routes to fill a 14x14 square:
  1. Horizontally
  2. Horizontally alternating row directions
  3. Vertically
  4. Vertically alternating column directions
  5. Diagonally up
  6. Diagonally up, but alternating directions
  7. Diagonally down
  8. Diagonally down, but alternating directions
  9. Spiral in, clockwise
  10. Spiral in, counter-clockwise
  11. Spiral out, clockwise
  12. Spiral out, counter-clockwise
You can then repeat each of those patterns from the four corners of the 14x14 square.

In terms of encryption, you may write the polybius square digits into the 14x14 square in any one of the 48 patterns, and remove the digits from any of the other 47 patterns. This yields 2,256 possible transpositions. They're not all unique due to some symmetry, but you may use any of the 2,256.

The reason I first devised this test is due to the mysterious "04" at the middle of the ciphertext. If that zero was marking the four as the end of the original ciphertext, you could fill a 14x14 square in some spiral pattern, and then remove the digits in one of a couple diagonal patterns to leave the 4 digit at the exact middle of the ciphertext. My curiosity was piqued so I set about writing a program to solve a cipher such as this.

After solving some test ciphers, I threw the D'Agapeyeff cipher into the program with much pomp and circumstance, but once again came up empty. Nothing scored so much as a 1.3 (0.05) for IC. Shucks.

Where does this leave me? I don't know. I've given this cipher all it can handle, but it continues to hold tight to it's secret.

I may finally start looking into the 28x7 or 7x28 shape and repeat some of the work I've done on the 14x14 square. Someday I'll win, but for now I will rest.