The Code Book by Simon Singh
Full title: The Code Book - The Science of Secrecy from Ancient Egypt to Quantum Cryptography.
This book documents the rich history of codes and ciphers. And I do mean "rich." As Singh points out in his introduction, codes "have decided the outcomes of battles and led to the deaths of kings and queens." It is a history with "stories of political ingrigue and tales of life and death."
Of particular interest to me is the Enigma Machine -- a mechanical cipher device used by the Germans in WWII. Resembling a typewriter, the Enigma Machine used a series of rotors, which electrically exchanged characters. The genius of this machine -- in addition to the huge number of variations allowed by multiple rotor choices, settings, and wirings -- was that the mechanism incremented with each input, thus changing the entire cipher for every letter.
Cryptography might seem associated with mathematics more than writing. So I found it interesting that some noted writers were cryptanalysts -- for example, Edgar Allan Poe and Sir Arthur Conan Doyle. Employed by a Philadelphia paper, Poe challenged readers to send him monoalphabetic substitution ciphers, and he broke them all (using relatively simple techniques of frequency analysis -- impossible to employ on Enigma ciphers).
But perhaps I shouldn't be surprised. As writers, we are intrigued by the deeper meanings that can be embedded in language. We consistently write and break the codes of simple puns and elaborate metaphors. We translate events, ideas, and emotions into text, then back again. I suspect that most of us enjoy crossword puzzles -- pulling the "right" words from the obscure depths of our vocabularies. So perhaps unlocking the secret meanings of seemingly incomprehensible text isn't as far removed from writing as one might think.
(Singh is also the author of Fermat's Enigma, an excellent book that chronicles mathematicians' attempts over the centuries to prove Fermat's Last Theorem.)