Spies have been around for a long time. Part of being a good spy is being able to send and receive coded messages. Lately, mathematicians have had a major role in trying to break these codes. There was a major movie, The Imitation Game, about mathematician Alan Turing and his breaking of the German Enigma code in World War II.
Codes go way before that, of course. I'm reading George Washington's Secret Six: The Spy Ring that Saved the American Revolution. The title seems a little overstated, but then again, I'm not done with the book yet. There are a couple of interesting items.
Invisible Ink - I always thought that was a made up thing. The author of the book says,
"The practice of writing with disappearing inks was nothing new. For centuries people had been communicating surreptitiously through natural and chemically manipulated inks that became visible when exposed to heat, light, or acid. A message written in onion juice, for example, dried on paper without a trace, but became readable when held to a candle. Secret correspondence in the British military often had a subtle F or A in the corner indicating to the recipient whether the paper should be exposed to fire or acid to reveal it message."
Interesting. Also, the coding itself was not as complicated as it is now, but still pretty effective. The book says that Benedict Arnold, when communicating with his British contact used,
"invisible ink and a book-based code. He based his code on two books: William Blackstone's Commentaries on the Laws of England and Nathan Bailey's An Universal Etymological English Dictionary. Each word was denoted by three numbers separated by a period. The first was the page number, the second was the line, and the third was the position of the word, starting from the left margin, in that line. for example, 172.8.7s stood for "troops": page 172, line 8, seventh word in. The s at the end simply made it plural."
The method is very clever. Although, if he was clever enough, Benedict wouldn't be so well known to us today.