# From Russia With Love

MI6 has discovered a recently activated Soviet Sleeper Cell operating in London, they've given the task to you to determine where, when, and how they will strike.

You come across the location of their last known meeting, the trail is several hours cold, but they've left a chessboard out looking like this.

A book is open to a historical game: Spassky v. Bronstein, Leningrad, 1960 complete with movelist and analysis. (For your convenience, the move list follows):

1.e4 e5
2.f4 exf4
3.Nf3 d5
4.exd5 Bd6
5.Nc3 Ne7
6.d4 0-0
7.Bd3 Nd7
8.0-0 h6
9.Ne4 Nxd5
10.c4 Ne3
11.Bxe3 fxe3
12.c5 Be7
13.Bc2 Re8
14.Qd3 e2
15.Nd6 Nf8
16.Nxf7 exf1Q+
17.Rxf1 Bf5
18.Qxf5 Qd7
19.Qf4 Bf6
20.N3e5 Qe7
21.Bb3 Bxe5
22.Nxe5+ Kh7
23.Qe4+ Kh8 1-0

You can tell it's the game for which the end position is on the board.

In the trash you find a crumpled index card, one side covered with mysterious writing.

S1R23R23S9s2p22 S9R23 S10S1S18P20
s19r6P17P20S7P5S3R23R8P15 s2p13S6S2S6p5R23
s13P22R23S5p13S1R18

Hint:

The method of encyphering is one->many, in database terms, however each symbol in the ciphertext decodes to exactly one symbol in plaintext, depending on the key used.

After several hours of investigation, you receive a call from your superiors.

Be careful, we have reason to believe this group has acquired a dangerous spore-based biological agent they may use in this attack.

• Jame Austem, the fanous movelist. – Rand al'Thor Oct 26 '16 at 16:03
• I have verified that (1) those are indeed the moves of a famous game played between those players on that date and (2) it is almost the right final position (the actual final position has the black king on h7, not h8). The contents of the index card look superficially like Forsyth-Edwards notation for a chess position (presumably with S=knight as is customary in many European countries) but clearly aren't actually quite that. – Gareth McCaughan Oct 26 '16 at 16:12
• I have seen the game in question called "The SMERSH Gambit" which kinda fits with the title and theme of this puzzle. – Gareth McCaughan Oct 26 '16 at 16:13
• @GarethMcCaughan strikes again! – dcfyj Oct 26 '16 at 16:19
• ... and this very game (with some gratuitous errors, perhaps because someone thought there was a copyright issue) features in the movie "From Russia With Love". White receives a message saying "You are required at once" near the end of the game, finishes it off and (I assume) goes off to do some spyish thing. – Gareth McCaughan Oct 26 '16 at 16:20

The message is:

ATTACK AT DAWN MORNINGTON CRESCENT ANTHRAX

and the cipher works as follows:

The spaces in the ciphertext are actual spaces. The material in between is a sequence of things like "P12" or "s19", each of which corresponds to one plaintext letter. In each:
- The number picks out one pair of moves in the chess game.
- The case of the letter indicates whether to look at White's move (for capitals P,R,S) or Black's (for lowercase p,r,s).
- The letter indicates which of three ways the plaintext letter is represented:
P,p indicate that it's given by the piece moved (K,Q,R,B,N,P);
R,r indicate that it's given by the kind of move (O for castling, written O-O or O-O-O; X for capture, written x; T for a check, written + which looks a bit like a lowercase t);
S,s indicate that it's given by the square moved to. See below for the details of this.

The Snn letters determinable from the above are:

 a b c d e f g h . . . . A . . . 8 . . . . . . . . 7 . . . . . M . . 6 . . . . . W . . 5 . . D E A C . . 4 . . H . . G . . 3 . . S . . . . . 2 . . . . . . . . 1

and M Oehm, who is so much smarter than I am, observes in comments that

if we delete from the alphabet the letters that already have other representations via pieces and move types (i.e., KQRBNP and TXO) and identify I and J in the usual way, we have just enough letters left to fill a 4x4 square ... and lo, they fit very nicely:

 a b c d e f g h A C D E A C D E 8 F G H I F G H I 7 L M S U L M S U 6 V W Y Z V W Y Z 5 A C D E A C D E 4 F G H I F G H I 3 L M S U L M S U 2 V W Y Z V W Y Z 1

And with that, all is explained.

A few worked examples. R23, which occurs several times, means: look at move 23; look at White's move 23 because R is a capital letter; observe that it's a check and therefore corresponds to letter T. s1 means: look at move 1; look at Black's move 1 because s is a lowercase letter; observe that on move 1 Black moved to e5 corresponding to the letter V. (There happens to be no V in the message.) And P7 means: look at white's move 7, observe it's made by a bishop, so the letter is B.

• The omitted letter is intentional, it cannot be encoded with this key, but the meaning of the text remains obvious regardless. I appear to have made an error in Word 4 that has now been corrected (S5->S7) I've gone back and double-checked everything else, and they decode correctly. – Sconibulus Nov 20 '16 at 15:59
• Correction: There is an encoding for the missing letter that I managed to miss repeatedly. It would have been S13, but it is not required to make sense of the message. – Sconibulus Nov 20 '16 at 16:32
• The 17 letters that aren't pieces or move types are A.CDEFGHIJ.LM.....S.UVW.YZ. You can group them in four groups of four: ACDE, FGHI, LMSU and VWYZ with the Playfair convention that I and J are encoded the same. Arrange them in a 4×4 square and put that square on the board four times. (Your sketch is very helpful and this method explains why both e4 and e8 decode to A.) – M Oehm Nov 20 '16 at 18:46
• Ah! It never occurred to me to delete the ones that have other encodings. D'oh! – Gareth McCaughan Nov 20 '16 at 19:23
• who is so much smarter than I am - er, no. I've added only the last bit to a puzzle that you've solved pretty much alone and that I couldn't get into when I tried to tackle it. – M Oehm Nov 21 '16 at 5:59