Cryptography is an interesting topic for security research. Recently a researcher put out a "decode me" challenge, and this blog describes what we did that may help others with more experience in cryptography solve the challenge once and for all.
The first step was to decode a garbled message as shown below. The two "=" signs at the end of this message signify that it might be base64 encoded.
After removing blanks,commas, and other garbage characters, and then decoding the base64 codes, we got a binary stream. This stream started with 0x1F8B, which is usually present for a gzip header. Unzipping the binary stream using gzip, we got a gif picture that showed a URL for the next challenge. In this challenge, players were asked to decrypt a cryptogram which was a paragraph taken from a book:
LFDT FXVT XQDT FTCL FCTB TPCY EGDJ
SRYP JPGC PTDD LFCJ PGNY ERLQ BLOY
DTFT CLFC TFXG RAYP BTPC YSFM YPRT
OLFC LFDG PYVT XQRA TFDG QRJP GCPT
DDYP QHYB LYUY HSRL FDTF XGRA YPVT
XQLR LQML IIYP YFRL FDGP YVTX QRAT
FDGQ RDTF TCYP QYWJ YER
The method by which I attacked this puzzle is best described as "Gestalt Psychology". After looking at the description, I knew that in this cryptogram, the key was created by taking the title of a book. The author gave very detailed information on the method of encryption. The indications were that the author had not expended energy on making the key hard to find, and therefore the book name might be well known, making this only a game rather than an enigma.
First, I searched "most popular books" and found some clues. I tried to use allbookstores.com with no success, but goodreads.com was much more useful.
Goodreads.com is the largest social network for readers in the world. There are many popular books but which book's title would be the key? There was another possible clue in the background of the game. The author was a computer engineer, and those trying to decrypt the challenge are obviously a group of computer guys, so the kind of books they are most conversant with would be in the computer category. So I decided to search for the book’s name in that category.
Finally, I tried the the listed books as possible keys to replace the cipher text, and the third was correct. I had only heard of the famous one in the list, “The Mythical Man-Month”, so I guessed it might be the key, and was lucky.
I took the title of the book and wrote down each unique letter from the title in the order it appeared. Once all letters from the title were used up, the remaining letters of the alphabet were added in order. The cipher table was:
Replace each letter in the cryptogram using the cipher table, and the plaintext was:
inma nywa ysma nagi ngal arge comp
uter prog ramm ingp roje ctis like
mana ging anyo ther larg eund erta
king inmo rewa ysth anmo stpr ogra
mmer sbel ieve buti nman yoth erwa
ysit isdi ffer enti nmor eway stha
nmos tman ager sexp ect
Then I corrected the segmentation of the words:
in many ways managing a large computer programming project
is like managing any other large undertaking in more ways
than most programmers believe but in many other ways it is
different in more ways than most managers expect
See also: A Simple N-gram Calculator: pyngram. Thanks to Tamas Rudnai for his quick solution to the base64 decode challenge.