I seem to remember a Sherlock Holmes story where two people exchange information in the following manner:

They each had a copy of the same book

The author of a message would find each word somewhere in the book, then write down:

  • The page number
  • The number of the word on the page (first, second, third...)
Then he'd send the list of number-pairs to his friend

Impossible to break without a copy of the book

Sherlock had intercepted a coded message, and was able to read it - but only by guessing which book had been used, knowing what he did about the author!

But I can't remember which story it was...