Лаборатория RuCTF Quals 2014. Crypto 200 Write-up

, 19 March 2014

Mary Queen of Scots goes chinese. We capture secret message from prison where Mary Queen stands. Help us figure out what message means. 

Using Google we can learn that Mary Stuart used to encrypt her messages with the substitution cipher. In her particular cipher all the letters were substituted with the letters from the cipher-alphabet with the exception of the most commonly used words. In that case the whole word was substituted with the special letter from the cipher-alphabet. 

Thus, the statistical characteristics of the text are almost intact, so we can use the frequency analysis to break the cipher. We build the letter distribution table of the cipher-text and compare it with a typical distribution of letters in English text, so we have an approximate key. Tweaking the distributions we finally get the famous “Alice in Wonderland” by Lewis Carrol. 

The flag is “alice in wonderland”.