Tea, milk, no
sugar. Thanks

Stuart Rutter, a developer at Square Enix in London. Enjoys cryptography, search algorithms, competitive coding, and start-up ventures.

Javascript
100%

PHP 5.x
100%

Objective-C (iOS)
100%

HTML5 & CSS3
100%

Node JS
90%

NRDBMS
90%

RDBMS
90%

Adobe CS
80%

Python
60%

Ruby
60%

Cryptography
50%

Chess
30%

Disclaimer: Howsoever expressed or interpereted, the opinions found herein do not represent those of my professional employer.

D'Agapeyeff Cipher not solved, FACT!

January 4th 2013

The D'Agapeyeff cipher is a cryptography challenge set by Alexander D'Agapeyeff in First Editions of his book Codes and Ciphers. It has since been removed from later editions and is yet to be broken.

75628 28591 62916 48164 91748 58464 74748 28483 81638 18174 74826 26475 83828 49175 74658 37575 75936 36565 81638 17585 75756 46282 92857 46382 75748 38165 81848 56485 64858 56382 72628 36281 81728 16463 75828 16483 63828 58163 63630 47481 91918 46385 84656 48565 62946 26285 91859 17491 72756 46575 71658 36264 74818 28462 82649 18193 65626 48484 91838 57491 81657 27483 83858 28364 62726 26562 83759 27263 82827 27283 82858 47582 81837 28462 82837 58164 75748 58162 92000

Upon trawling the internet for clues and attempts at breaking this cipher, I was led to a blog article Alexander D'Agapeyeff Cryptogram is SOLVED, which to all intents and purposes seems like a reasonable attempt, however the author couldn't have been more wrong!

Here is an explanation of the authors workings and why it is ultimately flawed.

Firstly he has split the cipher digits into bigrams:

75 62 82 85 91 62 91 64 81 64 91 74 85 84 64 74 74 82 84 83 81 63 81 81 74 74 82 62 64 75 83 82 84 91 75 74 65 83 75 75 75 93 63 65 65 81 63 81 75 85 75 75 64 62 82 92 85 74 63 82 75 74 83 81 65 81 84 85 64 85 64 85 85 63 82 72 62 83 62 81 81 72 81 64 63 75 82 81 64 83 63 82 85 81 63 63 63 04 74 81 91 91 84 63 85 84 65 64 85 65 62 94 62 62 85 91 85 91 74 91 72 75 64 65 75 71 65 83 62 64 74 81 82 84 62 82 64 91 81 93 65 62 64 84 84 91 83 85 74 91 81 65 72 74 83 83 85 82 83 64 62 72 62 65 62 83 75 92 72 63 82 82 72 72 83 82 85 84 75 82 81 83 72 84 62 82 83 75 81 64 75 74 85 81 62 92 00 0

And then by doing a frequency count of the first and second digits we can see that:

First:

  • 8 (80)
  • 6 (56)
  • 7 (41)
  • 9 (18)
  • 0 (4)

Second:

  • 2 (46)
  • 5 (45)
  • 4 (43)
  • 3 (39)
  • 1 (33)

I have listed these in frequency order, however the order used to construct a grid in the authors implementation was 8,6,7,9,0 and 2,4,5,1,3. I do not know what the reasoning behind this order was, but for the time being I'm going to roll with it.

 24513 8ABCDE 6FGHIKI/J Combined 7LMNOP 9QRSTU 0VWXYZ

Using this grid, we then take the original cipher and substitute the digit pairs for their corresponding letters in the grid (e.g. 7,5 = N):

NFACT FTGDG TMCBG MMABE DKDDM MAFGN EABTN MHENN NUKHN DKDNC NNGFA QCMKA NMEDH DBCGC GCCKA LFEFD DLDGK NADGE KACDK KKWMD TTBKC BHGCH FRFFC TCTMT LNGHN OHEFG MDABF AGTDU HFGBB TECMT DHLME ECAEG FLFHF ENQLK AALLE ACBNA DELBF AENDG NMCDF Q

Coincidentally (in my opinion), this generates a cipher text containing the keyword FACT. Tendentious as it may be, it seems like a genuine enough keyword, so lets go with it.

The next step of working was to overlay the word FACT with the above cipher text and extract the corresponding values (ignoring the first block of letters assumed to be N = null, followed by FACT the keyword):

FACT FTGD GTMC BGMM ABED KDDM MAFG

I've not listed them all for the sakes of brevity. From this we can see that column F is: F, G, B.. Column A: T, T, G.. etc.

The next step is where this working is significantly flawed. By laying the keyword FACT on top of the alphabet and then transposing the corresponding letter from our columns F,A,C,T.

FACT FACT FACT FACT FACT FACT FA ABCD EFGH IJKL MNOP QRST UVWX YZ

The author has then taken the columns F,A,C,T, and read the corresponding value from the above alphabet in a rather peculiar way:

F:

F = A1st letter, 1st group G = E1st letter, 2nd group B = I1st letter, 3rd group

A:

T = B2nd letter, 1st group T = F2nd letter, 2nd group G = J2nd letter, 3rd group

C:

G = C3rd letter, 1st group M = G3rd letter, 2nd group M = K3rd letter, 3rd group

T:

D = D4th letter, 1st group C = H4th letter, 2nd group M = L4th letter, 3rd group

When we reconstruct this it is no surprise that we then get the alphabet in return! Oh dear me.

FTGDABCD GTMCEFGH

comments powered by Disqus