206 Cryptogram II
YRFFJ OSLXA PQPQY APVRR DPNSA ZAPIK OXMQJ BOIMY XMSZZ FRIHE AUXJS IOROR IEAHB QYAPQ YRHXJ STRIF ORIEX KOIKD REAQK JHBOI QSFIQ AJHPA QPKIF FREKO XMQJB OIGAA LRKIS PRNSA Z13VI PIKOX MQJBO IGNSA ZIPVR FFYJM RXJSY IEUSH
There was some discussion on the mailing list about the objective of the quiz, due to its enigmatic nature. After the no-spoiler period expired, several people began contributing programs to explore the cryptogram.
Ken Bloom provided a solution to decrypt a rotation cipher. A rotation cipher is a simple substitution cipher where each letter is substituted with the letter a fixed number of positions ahead in the alphabet. An example of this is the Caeser Cipher or ROT13. This quiz did not happen to be a rotation cipher, but the algorithm used to encrypt the text was something along those lines.
Martin DeMello submitted an exploratory solution. His solution is well commented and documents the process of trying out different substitutions to crack the cipher.
There were attempts to use frequency analysis, which is frequently a good strategy to employ in working towards a solution. However, the original text contained the word ‘quiz’ three times, ‘cryptogram’ twice and ‘cryptography’ once. It also contained the words ‘rubyists’ and ‘puzzle’. These particular inclusions in the small amount of text skewed the distribution enough to make frequency analysis problematic.
Martin Boese was successfully able to crack the cryptogram. He counted repeated sequences to gain insight into possible words in the cipher text. In particular, the string
KOXMQJBOIG appeared more than once.
The text was encoded using a substitution cipher with the key phrase ‘ILKERUBY’ to create a mixed alphabet. The cipher text alphabet was created by removing the key phrase and prepending it to mix up the letters:
@cipher_text_alphabet = keyword_array + (@alphabet - keyword_array). Then each letter in the plain text message is replaced by the corresponding letter in the cipher text alphabet.
Have you guessed what the long word that was repeated in the cipher text was? It was
cryptogram. The encrypted text was actually the description of the quiz itself, though it wouldn’t help much until it is cracked.
Here’s the original plain text message:
Hello Rubyists, This week's quiz is a cryptography puzzle and if you are reading this then you've already cracked it. Congratulations! It's called Cryptogram II because quiz #13 was a cryptogram quiz as well. Hope you had fun!