Last month I mentioned a codebreaking puzzle tied in with the release of the new film about Alan Turing. The competition has just closed, but you might still be able to find it online if you feel like having a go.
If you want to know how to solve the puzzle, read on…
Note: There are spoilers below (obviously), so if you want to do this puzzle by yourself, then this is your last chance to look away.
Background
The puzzle consists of three ciphertexts and a map, which is divided into a grid of squares numbered A1, B1, C1 and so on up to L8. When decrypted, the ciphertexts identify a grid square on the map in which we are told Alan has hidden some silver.
Part 1: Monoalphabetic substitution cipher
FY VKQC KJ SNM JTWTD MJGOFT FTENGJM TS HDMSENDMY LTQC GR LQKOQMRRGJO VMDD HUS G TF EKJEMQJMI THKUS SNM VTQ KWMQTDD GA NGSDMQ IKMR GJWTIM SNMJ G TF EMQSTGJ RSMQDGJO VGDD EKDDTLRM G NTWM EKJWMQSMI FY RTWGJOR GJSK RGDWMQ HTQR TJI HUQGMI SNMF JMTQHY CJKVGJO FY IQMTIAUD FMFKQY G VGDD AKQOMS VNMQM UJDMRR G DMTWM FYRMDA QMFGJIMQR NMQM GR SNM AGQRS KA SNQMM EDUMR SK GSR DKETSGKJ SNM RGDWMQ GR HUQGMI RKFMVNMQM SK SNM VMRS KA RSTLDM NTDD
This was quite trivial to solve. The original word spacing has been preserved, and since SNM
crops up seven times, we can immediately guess that this corresponds to the word the
. If we go on to replace Tt HDetEhDeY
with at bletchley
in the first line, we get some easy words further down: thQee clUeR
↠ three clues
, and burGeI sKFeVhere
↠ buried somewhere
. The whole of the first line can then be decrypted: my worC oJ the JaWal eJiOma machiJe at bletchley LarC is LroOressiJO well
↠ my work on the naval enigma at bletchley park is progressing well
. Finally, the substitution A
↠ f
reveals the plaintext:
my work on the naval enigma machine at bletchley park is progressing well but i am concerned about the war overall if hitler does invade then i am certain sterling will collapse i have converted my savings into silver bars and buried them nearby knowing my dreadful memory i will forget where unless i leave myself reminders here is the first of three clues to its location the silver is buried somewhere to the west of staple hall
Tip: If you’re really lazy, just copy and paste the ciphertext into this automatic decryption tool.
Part 2: Monoalphabetic substitution with homophones
≈ ⟨ ⊨ · + ⊻ ⊨ ⋀ ⊻ ⟨ ⋀ ≡ ↔ ∀ ⊃ ⊕ ÷ × ∠ + ∼ + + ⊻ × ⊃ ⋈ + × ≡ ⊢ + × ∠ · ⋁ × ∞ ≡ ≈ ⟨ ∠ × ÷ ⊢ ∠ ∀ ⊃ + ⇒ √ → ÷ ¬ ∀ ⇒ ⊨ \ × ∞ ⇔ ∼ + ⇔ ∀ ⊃ ⋁ · ÷ ⋈ ∀ ⇒ ⊨ ⇒ ↔ ⋈ ⊻ ÷ × \ ≡ ∀ ⋀ ↔ ¬ ⋈ ∀ × ∞ ⊨ ⊻ ⋁ ⊃ ⊻ × ¬ + ⊥ ≈ × ÷ → ⊤ × ÷ ⇔ ∀ ⊃ ∠ ⋀ ÷ ⊃ ⊤ ⊤ × ÷ ⇔ ∼ ⊤ × + ⊨ ⟨ ∼ ⊕ × ∞ ⊨ ⊻ ≡ ⇒ ⊨ ⊨ ∀ ⇒ ÷ ≡ ∀ · ↔ ∀ ∞ ↔ 8 ∼ ⋈ · ⋁ × ∞ ↔ ≡ × ⋁ ÷ ⊃ · ⊢ ⇔ ∀ ⊃ + ⋀ √ ⋀ ⊨ ⊃ + ¬ ⊥ ≈ ⋀ ⋈ ∼ ⊕ ⇔ ÷ · + ⋈ ¬ ≡ ⊥ ⊨ × ÷ ∼ ⋀ ⋈ ⊃ ⊕ × + ⊻ ⊕ ⊨ ∞ ⇒ ⇔ × ⊤ ¬ + ⊻ ≡ ∀ ⊃ ⋈ ¬ ⊨ √ ⇒ ÷ ⊤ × ⊨ ⊨ × ∠ ⋈ ∼ ↔ ∼ ⋈ ∀ ¬ ⊻ ⊻ ⊃ + → · ⋈ ⇔ × ⊤ ⋈ ⇔ ⋀ + ⊨ ⊃ ⟨ ÷ × ⋀ ⊻ \ ⋀ ÷ ≡ × ⊤ ≈ ⟨ ÷ ⊃ ⊥ ∞ ⊨ ⋀ ÷ ⊕ ⟨ ⊕ ⊨ ⊃ ÷ × ∞ ↔ ⇒ ⇔ × ∠ × ÷ ⊢ + × ↔ ⇒ ≡ × ⋈ → ⊨ ⊤ ⊤ ∼ + · ⊨ ⊕ × ⊻ → ⊃ + ⊕ ÷ ⟨ \ ⇔ ⇒ ⊻ ⋁ ⟨ ⋀ ⊢ ÷ ∼ ⊃ ⊥ ⋈ ≈ · ÷ ¬ + ⊃ ≈ 3 ≈ · ⊕ ∀ ∼ + → ∞ ⋈ ∼ + ⊥ ≈ ⟨ ¬ + ¬ ⇔ ¬ ⋀ ⊨ ⋈
This one was much tricker, partly because it uses strange mathematical symbols, but mostly because there are more than 26 of them. This suggests that common letters like e
may have been encrypted using more than one symbol. (Or perhaps some of them represent numerals?) Let’s start by converting these symbols into something a bit more manageable (≈
↠ A
, ⟨
↠ B
, ⊨
↠ C
, and so on, with @#$%
standing in for characters 27–30):
ABCDEFCGFBGHIJKLMNOEPEEFNKQENHRENODSNTHABONMROJKEUVWMXJUCYNTZPEZJKSD MQJUCUIQFMNYHJGIXQJNTCFSKFNXE@ANMW#NMZJKOGMK##NMZP#NECBPLNTCFHUCCJUM HJDIJTI$PQDSNTIHNSMKDRZJKEGVGCKEX@AGQPLZMDEQXH@CNMPGQKLNEFLCTUZN#XEF HJKQXCVUM#NCCNOQPIPQJXFFKEWDQZN#QZGECKBMNGFYGMHN#ABMK@TCGMLBLCKMNTIU ZNONMRENIUHNQWC##PEDCLNFWKELMBYZUFSBGRMPK@QADMXEKA%ADLJPEWTQPE@ABXEX ZXGCQ
The map contains several place names that might appear in the ciphertext. But where? We know that the first two words aren’t Bletchley Park because that would require the letter B
in the ciphertext to correspond to the first L of Bletchley and the P of Park. (If that’s the case, then this isn’t a monoalphabetic cipher at all and we’re barking up completely the wrong tree.)
It would be a bit tedious to examine all the possibilities with pencil and paper. If you’re familiar with regular expressions then a tool like grep will make life a lot easier. You’ll need to do a bit more work to ensure that each dot corresponds to a unique letter, but it doesn’t take long. This is what I ended up with:
Place name | Matching regex | Possible matches |
---|---|---|
BLETCHLEYPARK |
.(.)(.)...\1\2..... |
(none) |
BLETCHLEYVILLAGE |
.(.)(.)...\1\2...\1\1..\2 |
(none) |
BRICKWORKS |
.(.)..(.)..\1\2. |
NMZJKOGMK# |
BUCKINGHAMROAD |
........(.)...\1. |
(none) |
CHURCHGREENROAD |
(.)(.).(.)\1\2.\3(.)\4.\3... |
(none) |
CROWNINN |
....(.).\1\1 |
LMNOEPEE |
DENBIGHHALL |
......(.)\1.(.)\2 |
(none) |
FARBLETCHLEY |
....(.)(.)...\1\2. |
ADLJPEWTQPE@ |
GRANDUNIONCANAL |
..(.)(.)..\2..\2.\1\2\1. |
(none) |
HOWEPARK |
........ |
FBGHIJKL , CUIQFMNY , PQDSNTIH , NSMKDRZJ , X@AGQPLZ , MDEQXH@C , EFLCTUZN , #XEFHJKQ , CKBMNGFY , K@TCGMLB , LCKMNTIU , IUHNQWC# , #PEDCLNF , WKELMBYZ , UFSBGRMP , K@QADMXE |
SIDINGS |
(.)(.).\2..\1 |
EGVGCKE , MLBLCKM |
STANLEYROAD |
..(.)......\1. |
@CNMPGQKLNE , N#XEFHJKQXC , QZGECKBMNGF , GRMPK@QADMX |
STAPLEHALL |
..(.).(.)..\1\2\2 |
(none) |
STMARYSCHURCH |
(.)...(.).\1(.)(.).\2\3\4 |
(none) |
WATEREATONROAD |
.(.)(.)(.)(.)\3\1\2(.).\4\5\1. |
(none) |
WATLINGSTREET |
..(.).....\1.(.)\2\1 |
(none) |
The first of these matches is unlikely to be correct because if NMZJKOGMK#
decodes to brickworks
, then the word that follows it must start with sbri
. So let’s try the next one. If LMNOEPEE
decodes to crowninn
, then we end up with the following:
ABCDnFCGFBGHIJKcrowninnFoKQnoHRnowDSoTHABworRwJKnUVWrXJUCYoTZinZJKSD rQJUCUIQFroYHJGIXQJoTCFSKFoXn@AorW#orZJKwGrK##orZi#onCBicoTCFHUCCJUr HJDIJTI$iQDSoTIHoSrKDRZJKnGVGCKnX@AGQicZrDnQXH@CoriGQKconFcCTUZo#XnF HJKQXCVUr#oCCowQiIiQJXFFKnWDQZo#QZGnCKBroGFYGrHo#ABrK@TCGrcBcCKroTIU ZoworRnoIUHoQWC##inDCcoFWKncrBYZUFSBGRriK@QADrXnKA%ADcJinWTQin@ABXnX ZXGCQ
This looks a bit more promising. In particular, it seems likely that the characters IJK
before crowninn
correspond to the word the
, since this also gives us other sensible patterns like the word when
later on in the first line:
ABCDnFCGFBGHthecrowninnFoeQnoHRnowDSoTHABworRwhenUVWrXhUCYoTZinZheSD rQhUCUtQFroYHhGtXQhoTCFSeFoXn@AorW#orZhewGre##orZi#onCBicoTCFHUCChUr HhDthTt$iQDSoTtHoSreDRZhenGVGCenX@AGQicZrDnQXH@CoriGQeconFcCTUZo#XnF HheQXCVUr#oCCowQitiQhXFFenWDQZo#QZGnCeBroGFYGrHo#ABre@TCGrcBcCeroTtU ZoworRnotUHoQWC##inDCcoFWencrBYZUFSBGRrie@QADrXneA%ADchinWTQin@ABXnX ZXGCQ
Since T is one of the most common letters in English, it wouldn’t be surprising to find another symbol used to represent this letter. The sequence Zhe
crops up three times, so perhaps Z
also decodes to t
. If so, encrBYt
in the penultimate line must surely be encrypt
.
AyCDnFCGFyGHthecrowninnFoeQnoHRnowDSoTHAyworRwhenUVWrXhUCpoTtintheSD rQhUCUtQFropHhGtXQhoTCFSeFoXn@AorW#orthewGre##orti#onCyicoTCFHUCChUr HhDthTt$iQDSoTtHoSreDRthenGVGCenX@AGQictrDnQXH@CoriGQeconFcCTUto#XnF HheQXCVUr#oCCowQitiQhXFFenWDQto#QtGnCeyroGFpGrHo#Ayre@TCGrcycCeroTtU toworRnotUHoQWC##inDCcoFWencryptUFSyGRrie@QADrXneA%ADchinWTQin@AyXnX tXGCQ
It looks like we’re on the right track now. Let’s replace #orthewGre##ort
with forthewareffort
, and QtanCeyroaF
with stanleyroad
(another place name that was matched in the table shown above).
AylDndladyaHthecrowninndoesnoHRnowDSoTHAyworRwhenUVWrXhUlpoTtintheSD rshUlUtsdropHhatXshoTldSedoXn@AorWforthewareffortifonlyicoTldHUllhUr HhDthTt$isDSoTtHoSreDRthenaValenX@AasictrDnsXH@loriasecondclTUtofXnd HhesXlVUrfollowsitishXddenWDstofstanleyroadparHofAyre@TlarcycleroTtU toworRnotUHosWlffinDlcodWencryptUdSyaRrie@sADrXneA%ADchinWTsin@AyXnX tXals
Now it’s getting much easier. secondclTUtofXndHhesXlVUrfollows
is obviously secondcluetofindthesilverfollows
. Also, AylDndlady
↠ mylandlady
, doesnotRnowaSoutmyworR
↠ doesnotknowaboutmywork
, W
↠ e
, and @
↠ g
…
mylandladyatthecrowninndoesnotknowaboutmyworkwheneverihelpoutintheba rsheletsdropthatishouldbedoingmoreforthewareffortifonlyicouldtellher thathut$isabouttobreakthenavalenigmasictransitgloriasecondcluetofind thesilverfollowsitishiddeneastofstanleyroadpartofmyregularcycleroute toworknotetoselffinalcodeencryptedbyakriegsmarinem%machineusingmyini tials
There are only two symbols left now — $
and %
. We know Turing worked in Hut 8 at Bletchley, so $
↠ 8
. But what about %
? This is easily solved by looking at these characters in the original ciphertext where the numerals 8 and 3 are used in these positions. Apparently these characters weren’t encrypted at all. Here’s the key I ended up with:
Symbol | Corresponds to | Symbol | Corresponds to |
---|---|---|---|
· , ⋀ |
A |
⋁ |
B |
⊕ |
C |
⊻ |
D |
→ , ⇒ , ⊃ |
E |
⊤ |
F |
⊥ |
G |
∀ |
H |
¬ , ∼ |
I |
⊢ |
K |
⊨ |
L |
≈ |
M |
+ |
N |
× |
O |
\ |
P |
÷ |
R |
⋈ |
S |
↔ , ⇔ , ≡ |
T |
∞ |
U |
√ |
V |
∠ |
W |
⟨ |
Y |
Part 3: Enigma cipher
Walzenlage: III I II Umkehrwalze: B Ringstellung: S B E Steckerbrett: LD ER FA S...? Grundstellung: ? ? ? RPVZL YNCQO RVUSY UZUBC KNIBK DWZRP FZVLA
Based on the decryption of Part 2, it appears that these are the settings to be entered into a Kriegsmarine M3 Enigma machine in order to decrypt the final message. A quick search led me to an online M3 Enigma simulator that does the job. As per the instructions in Part 2, we should use Alan Turing’s initials for the initial indicator setting (Grundstellung): A M T
. The only thing we are missing here is the remainder of the plugboard settings (Steckerbrett), which have been partially obliterated. If we use only the first three plugboard settings, this is what we get:
THENI LHERI NNODT HEANT FHOMM YLODG ISGNX
It doesn’t take much effort to figure out that S and N should be swapped around, so let’s add SN
to the plugboard and try again:
THESI LVERI SSOUT HEAST FROMM YLODG INGSX
If you connect the lines running west from Staple Hall and southeast from the Crown Inn, you’ll end up at cell C3.
You really did #2 the hard way. If you had recognized the symbols as standard logical symbols, and looked them up (for example, see “logical symbols” in Wikipedia), you would have seen immediately that a number of them all represent the same logical function, and by implication the same letter in the code. This would have given you plaintext E and T right away, and strong hints to other letters as well based on a frequency count.
Haha, yes that would have helped a lot! With the homophones resolved from the outset, the first half of the ciphertext comes out as
EFGAH IGAIF ADDJB KLMNH CHHIM BOHMD PHMNA QMRDE FNMLP NJBHB SBLCJ BGTMR DCHDJ BQALO JBGBD OILMT DJADC OJMRG IQBIM CHUEM LBVML DJBNA LBVVM LDCVM HGFCK MRGID BGGJB LDJAD JRD8C OAQMR DDMQL BAPDJ BHASA GBHCU EA
, and quipqiup can crack this in five seconds flat.