The story of the three ciphertexts originates from an 1885 pamphlet detailing treasure being buried by a man named Thomas J. Beale in a secret location in Bedford County, Virginia, in the 1820s. Beale entrusted a box containing the encrypted messages to a local innkeeper named Robert Morriss and then disappeared, never to be seen again. According to the story, the innkeeper opened the box 23 years later, and then decades after that gave the three encrypted ciphertexts to a friend before he died. The friend then spent the next twenty years of his life trying to decode the messages, and was able to solve only one of them which gave details of the treasure buried and the general location of the treasure. The unnamed friend then published all three ciphertexts in a pamphlet which was advertised for sale in the 1880s.