John Dooley (Computer Science) has published an anthology of short stories as an ebook on Amazon titled “Codes and Villains and Mystery: The Best Stories with Codes and Ciphers 1843-1920”.
The stories, originally published before 1924, are written by various authors and each story uses a code or cryptogram as a plot element. Dooley edited the stories, added an introduction to the book and an intro for each of the stories. Stories written during this time that use crypto include ones by Edgar Allan Poe, Arthur Conan Doyle, and Sax Rohmer (of Dr. Fu-Manchu fame).
Dooley’s web page of crypto fiction: http://faculty.knox.edu/jdooley/Crypto/CryptoFiction.htm