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 Latin and Latin-translated Greek documents, and the Old Testament is an English translation of a Latin 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.
- 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, verses from The Bible are listed. It's a Red Herring: the codebreakers at the FBI are smart enough to notice that Jonah 6:8 can't be meaningful when Jonah only has four chapters. However, they don't know what book is actually being referenced. Lloyd Bowman eventually determines that the cipher corresponds to page, word and letter in Hannibal the Cannibal'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.
- Subverted in the finale of Without a Clue, where Holmes finds a note that he thinks is a book cipher, which refers to Psalms 22, which talks about the Valley of the Shadow of Death, and The Shadow of Death is the name of a play that has only been shown in one theatre in London in the recent past. Moriarty turns out to be there, and then Holmes learns from the kidnap victim that the Shadow of Death reference was pure coincidence, as the numbers also matched the street address of the theatre.
- 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.
- 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).
- In 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.
- How Firm a Foundation uses a page-line-word book cipher with the numbers disguised as scripture references. Since the message only says how to get at a concealed (and unencrypted) letter, it's short enough that even the Inquisition spies examining it fall for the scripture-references cover.
- Flashman and the Mountain of Light. Flashman gets a nasty shock when he's Lured into a Trap by a false message while working undercover in India. First they captured and tortured the courier who passed on his messages, then brought in a cryptographer (cryptography is an Indian invention, as they point out) to crack the code, getting all the evidence they need.
- Red Dragon contains the same Red Herring book cipher as its film version, listed above.
- Heralds of Valdemar: At one point in the Collegium Chronicles, a team of foreign spies/assassins gets their orders via a book code using a book of poetry as the key. Unfortunately, when they have to flee in a hurry, they lose the book, and since it's from their homeland they can't replace it in Haven.
- 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. The book used for the cipher is believed to have been Blackstone's Commentaries on the Laws of England, which was a relatively common key, next to The Bible.