This is an old and basic cipher.
John Doe has a copy of a book. Richard Roe has an identical copy of the same book, which he can use to decipher John's coded messages and code his own replies. The messages are written out in groups of numbers. Either the first number is a page, the second number a line on the page, and the third number a word inside that line, or it can also be just the page number and word number, if you want to make it easy. The Ottendorf Cipher is a specific variant that uses Page, Word, and then the letter inside that word, which lets you encode words that aren't found within the text - like, say, the address of a meeting place.
Big and well-known books make better sources as you have more words to choose from (thus The Bible is often the source), and no one will react if you're walking around with a pocket version of The Da Vinci Code. Relatedly, if you are unfortunate enough to lose your copy, a well-known book will be easier to replace without raising eyebrows, though some books are slightly different from edition to edition, so you need to make certain to get the right one (This also applies to the Bible, as the New Testament is an English translation of a collection of Greek documents, and the Old Testament is an English translation of a Greek translation of a collection of Hebrew documents. Better make certain you specify which version you want, as exact word choice can vary considerably between versions even if the general meaning of any given verse stays roughly the same). If you're walking around with an 1824 edition of a book, or asking specifically to buy a copy of the fourth printing of the second edition of something... people may well get suspicious (especially the detective who's after you). Of course, using a widely available book also makes it easier for other people to read your messages, should they be intercepted, and while the book itself may be utterly innocuous, sending a letter that is merely a long list of numbers is an unmistakeable indication that you are communicating in code.
In some video games, solving such a code using an external manual is part of its Copy Protection.
- In Lost: Mystery of the Island, a series of four jigsaw puzzles released in 2007, Ottendorf cipher was used on each puzzle's box to hide spoilers and reveal information about the show to the fans.
- In Naruto, Jiraiya uses a book cipher referring to his own novels to convey information about Pain.
- A Detective Comics story "And the Executioner Wore Stiletto Heels" (issue #630) involved the villain, Stiletto, using an obscure book about shoes for a cipher (the villain chose this book as a pun on his name—think "stiletto heels"). When Batman goes to the bookstore, the owner mentions how strange it is that he just sold several copies of a book nobody would buy normally. Batman asks him who bought the book in order to learn who's in on the plot.
- In National Treasure, the hero discovers various numbers hidden on the back of the Declaration of Independence; these correspond not to a book per se, but to the 'Silence Dogood' letters his father donated to a museum.
- In the film Unknown (2011), Prof. Bressler's passwords are obscured by an Ottendorf cipher.
- The film version of Red Dragon has the serial killer and Hannibal Lecter communicate by posting a notice in a tabloid personal section. To pass a hidden message this way, some bible verses are listed. The FBI recognizes that some of the verses don't exist, and are actually an example of this trope; the chapter:verse numbers correspond to page and word in Lecter's copy of The Joy of Cooking.
- In The Devil-Doll, Levonde gets a threatening message to Matin this way. Although it's not much of a cipher, since Matin doesn't know the code, so Levonde writes out each Bible verse and word for him to look up.
- The Baader Meinhof Complex. Moby-Dick is used when passing coded messages from the terrorists in their maximum security prison to their followers on the outside.
- The Sympathizer: The narrator, a Vietnamese Communist spy reporting back to Hanoi about the activities of anti-Communist Vietnamese in America, uses such a cipher, which he combines with using invisible ink.
- This is described and used in The Curse of Chalion by Lois McMaster Bujold. In a culture in which printing is a relatively recent invention, there aren't many true duplicates, but the characters manage to turn up identical copies of a heavy theological tome.
- In The Valley of Fear, Sherlock Holmes decrypts a message enciphered with a book cipher by deducing which book had been used as a key text, though he does get messed up at one point because the letter was written at the turn of the year and the cipher key was an almanac, resulting in Holmes' first guess as to which edition of the almanac to use being wrong.
- In Raymond Smullyan's The Chess Mysteries of Sherlock Holmes, the book used is The Chess Mysteries of the Arabian Knights... which in the real world is also by Smullyan, but in-universe is attributed to "Dnomyar Nayllums".
- The name of Ken Follet's World War II thriller The Key to Rebecca refers to a German spy in Cairo using Daphne du Maurier's novel Rebecca as the basis of a code.
- In A Presumption of Death, Lord Peter Wimsey, on assignment for British Intelligence in WWII Nazi-occupied Europe, uses a code based on the works of John Donne. The Germans, suspecting that an intelligence service in which Oxonians have a major role would choose a classical work of English literature, systematically try such works until hitting the right one and breaking the code, coming near to catching the spy. Wimsey then improvises a new code, based on an unpublished text known only to himself and his wife.
- Another Wimsey example at one remove is in Have His Carcase, using a Playfair Cipher with the keyword (the tenth word on page 583 of the latest edition of a Chambers' Dictionary) disclosed this way.
- Graham Greene's heroes often use book codes. In The Human Factor, several books are used, and an edition of Charles Lamb's Tales from Shakespeare is used in Our Man in Havana.
- The heroes of the Matthew Reilly novel Six Sacred Stones used a book cipher to send confidential messages to each other. The key text was the Harry Potter books, but the messages were sent via a Lord of the Rings forum to make the key text harder to identify.
- The German spy uses this kind of encryption in The Death of Achilles.
- Used in The Adventures of Good Soldier Svejk in the World War I when the officers are briefed on the newest cipher method, which apparently is a variant of the book cipher based upon the pages 160 and 161 of a German novel "Die Sünden der Väter". However, the book used is a novel in two volumes and the protagonist, when ordered to deliver them to the battalion officers, was not informed that it was the second part which was needed and delivered the first tomes only, keeping the second volumes in storage, believing that 'they gentlemen officers would surely like to read the novel in the proper order, as anyone else, and after they had read the first part they'd be issued with the second part'. Hilarity ensued during the briefing, when only (overly ambitious yet generally incompetent) officer-cadet Biegler was brave enough to point out that the example given does not make any sense, while other officers just kept calm and quietly assumed that their regimental colonel finally went completely bananas and would be soon promoted to the war ministry.
In your example, the first word of the deciphered message is "Auf"note but ours had come out "Heu"note !
- Between Silk and Cyanide. The SOE radio transmissions to their agents in Nazi-occupied Europe use a poem memorized by the agent, despite the author arguing that such codes are easily broken. He does however convince some agents to use poems they've made up themselves, rather than well-known poems they've learned at school (which the Germans would likely know about).
- By Heresies Distressed: A group of Temple Loyalists uses a four-number book cipher (page, paragraph on that page, sentence in that paragraph, word in that sentence) to plot Sharleyan's assassination. While the cipher itself was devised by the Church centuries earlier, one plotter notes the irony that Charis' "heretical" introduction of Arabic numerals note makes the cipher much easier to use.
- In the "The Blind Banker" episode of Sherlock, they encounter a number of symbols. This turns out to be numbers written in an ancient Chinese script, with the book being a Tour Guide of London (which ends up as part of Fridge Brilliance, as the Chinese Gang use these symbols to arrange meeting points.
- In the Season 2 finale of BBC's Luther, the numbers in a notebook is revealed to be this. This gives the police an Oh, Crap! moment when the suspect's Room Full of Crazy turns out to be full of books. But as any book used must not only be the same title, but also the same edition, Luther realises this collection of secondhand books can't be the one used for the cipher. It's a Gideon's bible that the killers could find in any hotel room if needed.
- Sharpe: A book cipher plays an important role in the TV version of Sharpe's Sword. The key text is Voltaire's Candide.
- "The Fisher King", a two-part episode of Criminal Minds, features an Ottendorf cipher part of a larger puzzle to find a girl who had been missing for two years. The key text was The Collector by John Fowles.
- Burn Notice uses this, especially in the fourth season, where it becomes part of the season-long plot when Michael Westen steals a Bible from a safe deposit box that is the code book of Simon.
- The Mentalist: While undercover in the "Orange Blossom Ice Cream" episode, Jane is given a string of 81 numbers by a terrorist Arms Dealer so that Jane can use his Photographic Memory to smuggle them to a contact in America. Jane quickly figures out that the numbers are a book cipher as the arms dealer keeps two filled bookshelves and, in Jane's words, "he's not a reader". After the American contact is killed, Jane has to break into the arms dealer's home to figure out which of the many book acts as the key.
- In The Unit episode "Paradise Lost", Jonas Blane uses a book code from the poem Paradise Lost to communicate to his wife, Molly, that he has arrived safely in Panam.
- Castle: In the episode "Tick, Tick, Tick..." a serial killer taunts police with a message encoded in what Castle figures out is a book cypher, based on his latest Nikki Heat novel.
- Person of Interest.
- The Machine passes on the social security number of each potential Victim or Villain of the Week via a list of numbers and letters that correspond to the Dewey classification of the books in Finch's library.
- In one episode, Finch works out a Public Secret Message is a book code, and also realizes from the choice of book (on American Revolutionary War heroes) that it was sent by privacy terrorist group Vigilance.
- A variation in an episode of Murder, She Wrote set in Russia. One of the clues in the Murder of the Week was a manuscript about Soviet politics, beginning with the sentence, "The first and last word on the fate of Lenin was always in the hands of the Soviet people." After noticing a number of glaring grammatical errors, Jessica Fletcher realized that the first sentence was the key to the code; the first and last words on each page, read consecutively, revealed the identity of a Soviet official who turned traitor.
- Wiseguy does a different version whenever the protagonist, undercover cop Vinnie Terranova, wants to pass on information to Lifeguard. He gives an authentication code consisting of words taken from that day's newspaper.
- In The Borgias, Micheletto's new lover Pascal is actually a spy for Caterina Sforza and is using a Book Cipher based on the poetry of Catullus. Even though Micheletto catches on that Pascal is doing this, he can't read. He can accurately redraw the shapes of letters, though, so he copies everything and takes it to Cesare to decipher.
- Seventeen Moments of Spring: Stirlitz, a Soviet Deep Cover Agent in Nazi Germany in the closing months of World War II, uses one of these to decode messages sent from Moscow.
- One episode of Cyberchase used this, using a cookbook with the page-line-word code. Once the main characters find out that Hacker has a copy of the book and is using it to decode their messages (with no real explanation as to how he figured out what kind of code they were using and what book was the key), they quickly come up with a new code. Clueless Hacker still thinks the code is the same when he intercepts the new message.
- The infamously unsolved Taman Shud case seems to involve a "one-time pad" cipher using the edition-and-page method with a specific edition of the Rubaiyat of Omar Khayyam. Unfortunately, there's some other element of the key that has never been determined, so the cipher remains unsolved.
- The Beale Ciphers are possibly a case of this. At the least, the second of the three documents, the one indicating the contents of the treasure, maps to the letters in the Declaration of Independence. Of course, there's also some evidence that it was a hoax from the start.
- Benedict Arnold tried to use these while plotting his defection to the British.