National Treasure uses the Ottendorf cipher, invisible ink, Pigpen cipher, and the real Silence Dogood letters. Some of the cryptography is real. Some is Hollywood. Here is the breakdown.
The 2004 Disney film National Treasure sends Nicolas Cage's character, Ben Gates, on a hunt for a Templar and Freemason treasure hidden behind the Declaration of Independence. The plot runs on a chain of ciphers and clues: invisible ink on a 280-year-old letter, a book cipher keyed to Benjamin Franklin's teenage writings, and Masonic symbols etched into currency.
The surprising part is how much of the cryptography is real. The Ottendorf cipher is a genuine book cipher variant with documented historical use. The Silence Dogood letters were actually written by a 16-year-old Benjamin Franklin. Invisible ink has been a real steganographic technique since antiquity. The movie gets more cryptography right than most people give it credit for.
The fiction is in the specifics. The Declaration of Independence does not have a hidden map on its back. The Silence Dogood letters do not contain invisible ink clues. But the techniques themselves are sound. You can try the real versions with the Ottendorf cipher tool and the Pigpen cipher tool.
The Silence Dogood letters are real, and their authorship by Benjamin Franklin is well documented.
In 1722, a 16-year-old Benjamin Franklin was working as an apprentice in his brother James Franklin's print shop in Boston. James published the New-England Courant, one of the early American newspapers. Benjamin wanted to contribute but knew James would not publish his younger brother's work. So he wrote 14 letters under the pen name "Silence Dogood," a fictional middle-aged widow with strong opinions about religion, education, and Boston society. James published them without knowing the true author. The Wikipedia article on the Silence Dogood letters covers the full history.
Franklin slipped the letters under the print shop door at night. The Courant's readers found them entertaining, and James ran them for several months. When Benjamin eventually revealed himself as the author, James was apparently displeased, and the brothers' relationship deteriorated. Benjamin left Boston for Philadelphia later that year. The letters themselves survive in archives of the New-England Courant.
In National Treasure, the film's plot hinges on invisible ink on the original Silence Dogood letters, which reveals a clue to the next stage of the treasure hunt. The letters are real. The invisible ink is fiction. There is no historical record of invisible ink on the Silence Dogood letters, and the original documents are preserved in archives where no such markings have been found. The movie uses the real historical artifact as a prop and adds a fictional cryptographic layer on top of it. This is a common pattern in the film: real history plus invented clues.
The cipher that drives the film's first major puzzle is an Ottendorf cipher, and it is a real technique.
An Ottendorf cipher (also called a running-key book cipher) uses three-number groups to encode plaintext. Each group (page, line, word) points to a specific word in a shared reference text, called the key book. To decrypt, you look up each group in the agreed-upon book and extract the corresponding word. The security depends on the key book being known to both parties but not to interceptors.
In the film, the Silence Dogood letters serve as the key text. The cipher text is a sequence of three-number groups that, when decoded against the letters, reveals a message about the next clue. The Wikipedia article on book ciphers describes the Ottendorf variant and its history.
The Ottendorf cipher has real historical precedent. The most famous example is the Beale ciphers, three ciphertexts published in 1885 that supposedly describe the location of a buried treasure in Virginia. One of the three Beale ciphers was solved by James Ward in 1885 using the Declaration of Independence as the key text. The other two remain unsolved as of 2026. The solved cipher (Beale Cipher No. 2) uses a book cipher where each number corresponds to the first letter of the word at that position in the Declaration. The Ottendorf variant, which uses full three-number coordinates instead of a single index, is more flexible because it encodes entire words rather than single letters.
The film's use of the Ottendorf cipher is technically accurate. The three-number format, the need for a shared key text, and the decoding process are all correct. You can experiment with the mechanics using the Ottendorf cipher tool on this site, which lets you encode and decode using any reference text you provide. The book cipher tool covers the simpler single-index variant used in the Beale ciphers.
One detail the movie glosses over: in practice, an Ottendorf cipher requires both parties to have identical copies of the key text. If the editions differ (different pagination, different line breaks), the cipher breaks. Using a specific set of historical letters as the key text is plausible but would require both parties to have access to the exact same physical documents or precise transcriptions.
Invisible ink is one of the oldest steganographic techniques, and the film uses it in two places: on the Silence Dogood letters and on the back of the Declaration of Independence.
Invisible ink works by writing with a substance that is not visible under normal conditions but can be revealed through a physical or chemical process. Common historical methods include writing with lemon juice, milk, or urine, which become visible when heated. Chemical inks require a specific reagent to develop. The technique dates back to antiquity. Philo of Byzantium described invisible ink methods in the 3rd century BCE, and both sides in the American Revolution used invisible ink extensively. George Washington's spy network, including agent James Jay, used chemical inks that required specific developers.
The film shows invisible ink being revealed by heat (breath or a hair dryer on the Declaration) and by lemon juice on the Silence Dogood letters. The heat-reveal method is real for certain organic fluids. The lemon juice method is real: lemon juice oxidizes when heated and turns brown, making the writing visible. The Wikipedia article on invisible ink covers the chemistry and history.
Where the film takes liberty is in the specific applications. The Declaration of Independence does not have invisible ink markings on its back. The real document, housed at the National Archives in Washington, D.C., has been examined extensively by conservators. No hidden map exists. The Silence Dogood letters similarly have no documented invisible ink content. The film takes a real technique and applies it to real historical documents in a fictional scenario.
You can experiment with real steganographic techniques using the invisible text tool, which demonstrates methods for hiding and revealing text. The broader field of steganography goes well beyond invisible ink to include digital methods like LSB (least significant bit) encoding in images, which is covered in our steganography overview.
The film's central MacGuffin is an invisible map on the back of the Declaration of Independence, revealed by heat, that leads to the treasure. This is pure fiction.
The Declaration of Independence is a single sheet of parchment measuring approximately 24 by 29 inches. It is housed in a sealed, argon-filled case at the National Archives Building in Washington, D.C. The document has been examined by conservation staff using spectroscopic and imaging techniques. The back of the parchment contains a handwritten note ("Original Declaration of Independence dated 4th July 1776") that was added at an unknown later date. There is no map.
The idea of hidden information on the Declaration is a compelling plot device because the document is real, famous, and physically accessible (behind bulletproof glass). The film exploits the audience's familiarity with the document to make the fictional map feel plausible. But no historian or archivist has ever reported finding hidden markings, invisible ink, or a map on the Declaration. The National Archives has publicly stated that the document contains no such features.
The film also implies that the Freemasons encoded treasure clues into American currency, the architecture of Washington, D.C., and national monuments. The Masonic symbolism on the dollar bill (the Eye of Providence, the pyramid) is real and well documented. The claim that these symbols form a treasure map is fiction. The symbols were chosen in 1782 by a committee that included several Freemasons, but the selection was driven by standard heraldic and iconographic conventions of the era, not by a coordinated cipher scheme.
The Pigpen cipher, also called the Masonic cipher or Freemason's cipher, is real and appears throughout National Treasure as part of the Freemason symbolism.
The Pigpen cipher is a geometric substitution cipher. Each letter of the alphabet is assigned to a position in a grid (or in crossed grids), and the cipher symbol is the shape of the grid section surrounding that letter, with or without a dot to distinguish letters in similar positions. The result looks like a series of geometric shapes rather than letters. The cipher was used by Freemasons in the 18th century to keep their records private, which is why it carries the Masonic name. The Wikipedia article on the Pigpen cipher documents its history and usage.
The cipher is a monoalphabetic substitution, which means it is breakable by frequency analysis just like Atbash or Caesar. It offers no real security against a determined analyst. Its appeal is visual: the ciphertext does not look like text, which provides a layer of obscurity. In the film, the Pigpen symbols appear on various surfaces and are decoded to reveal clues. The visual decoding process shown in the movie is accurate. You can encode and decode Pigpen cipher text with the Pigpen cipher tool.
The Freemason connection in the film is overstated but not invented. Freemasonry was genuinely influential among the American Founding Fathers. George Washington, Benjamin Franklin, and Paul Revere were all Freemasons. Masonic symbols appear on the Great Seal of the United States and on currency. The film takes these real facts and weaves them into a conspiracy that does not exist. The symbols are real. The treasure map they supposedly form is not.
The film's use of the Pigpen cipher is one of its more accurate cryptographic elements. The cipher is real, it was used by Freemasons, and the decoding process shown on screen is mechanically correct. The inaccuracy is in the implication that the Founding Fathers used it to encode the location of a vast treasure. They did not. They used it for lodge records and private correspondence, not for hiding national secrets.
Yes. The Ottendorf cipher is a real book cipher variant that uses three-number groups (page, line, word) to point to words in a shared reference text. It has documented historical use, including in the Beale ciphers. The film's depiction of the decoding process is technically accurate.
Yes. Benjamin Franklin wrote 14 letters under the pen name 'Silence Dogood' in 1722, when he was 16 years old. He submitted them to his brother James Franklin's newspaper, the New-England Courant, which published them without knowing the true author. The letters are real and preserved in archives.
No. The Declaration of Independence has been examined extensively by conservators at the National Archives. The back of the document contains a handwritten label but no map, invisible ink, or hidden markings. The invisible ink map in National Treasure is a fictional plot device.
The Pigpen cipher (also called the Masonic cipher) is a geometric substitution cipher where letters are represented by grid shapes. Freemasons used it in the 18th century to keep lodge records private. It is a real cipher, though it is a monoalphabetic substitution and breakable by frequency analysis.
Yes. The Beale ciphers are three ciphertexts published in 1885 that supposedly describe the location of a buried treasure in Virginia. One was solved using the Declaration of Independence as the key text. The other two remain unsolved as of 2026, and some researchers question whether the treasure ever existed.
Ottendorf Cipher (3-Part Book Cipher)
Encrypt and decrypt messages using three-number groups (line-word-letter or page-line-word) that reference positions in a shared text.
Pigpen Cipher
Grid-based substitution cipher using geometric symbols to represent letters.
Invisible Text
Hide text using zero-width characters that are invisible to the eye.
Book Cipher Tool
Encode and decode messages using position references to any text or book.
The Ottendorf Cipher: How Revolutionary War Spies Used Books as Keys
Benedict Arnold used a book cipher to communicate with the British. The key was a legal textbook. Without the exact same edition, the code was unbreakable. Here is how the Ottendorf cipher works.
What Is Steganography? Hiding Data in Plain Sight
Steganography hides the existence of a message, not just its content. Learn how LSB image steganography works, how zero-width characters hide text, and how steganalysis detects hidden data.