Dan Brown's The Da Vinci Code uses the Atbash cipher, anagrams, and Fibonacci sequences. Some are real cryptography. Some are fiction. Here is which is which.
Dan Brown's 2003 novel The Da Vinci Code sold over 80 million copies and put cryptography in front of people who had never thought about substitution ciphers. The book's puzzles are a mix of real historical ciphers, literary anagrams, and outright fiction. The Atbash cipher that Brown describes is genuine, ancient, and still works exactly the way the book says it does. The Priory of Sion is a documented hoax.
This matters because millions of readers formed their understanding of cryptography from a thriller. Some of that understanding is accurate. Some of it is not. Sorting out which is which is the point of this post. You can follow along with the Atbash cipher tool and the Vigenere cipher tool as we go.
The Da Vinci Code layers several puzzles into its plot. The first clue the protagonists encounter is a sequence of anagrams. The phrase "O, Draconian devil!" and "Oh, lame saint!" are anagrams of "Leonardo da Vinci" and "The Mona Lisa." These are not ciphers in any technical sense. Anagrams are rearrangements of letters, and they carry no key. They are word puzzles, not cryptographic transformations.
The more substantial cryptographic element is the Atbash cipher, applied to the phrase "Sofia" and to the clue "So dark the con of man." The latter is an anagram of "Madonna of the Rocks," a real Leonardo da Vinci painting. Brown uses the Atbash cipher as a second layer on top of the anagram mechanic, which gives the puzzle a veneer of classical cryptanalysis.
A Fibonacci number sequence appears as a bank account code. The numbers 1-1-2-3-5-8-1-3-2-1 are a scrambled version of the first ten Fibonacci numbers. This is a recognition puzzle, not encryption. You either know the Fibonacci sequence or you do not. There is no key to recover and no ciphertext to decrypt.
The book also references the Vigenere cipher in Brown's broader body of work, and the dust jacket of early editions referenced the CIA's Kryptos sculpture, a real encrypted artwork installed at CIA headquarters in 1990 by Jim Sanborn. That reference alone drove significant public interest in cryptography, which we will come back to.
The Atbash cipher is the strongest piece of real cryptography in the novel. Brown's description of it is accurate.
Atbash is a monoalphabetic substitution cipher where the Hebrew alphabet is reversed. The first letter Aleph maps to the last letter Tav. The second letter Bet maps to the second-to-last letter Shin. And so on through the entire alphabet. In the English alphabet, A maps to Z, B maps to Y, C maps to X, down to M and N swapping with each other. The mapping is fixed. There is no key. Everyone who knows the algorithm produces the same output.
The cipher appears in the Hebrew Bible. Jeremiah 25:26 and Jeremiah 51:41 both use the word "Sheshach," which is an Atbash encoding of "Babel" (Babylon). Under the Atbash mapping, the Hebrew letters Shin-Shin-Kaf transform to Bet-Babel-Lamed, producing "Babel." This is one of the oldest documented uses of a substitution cipher, dating to roughly the 6th century BCE. Bruce Schneier discusses Atbash and other biblical ciphers in Applied Cryptography (1996, John Wiley & Sons) as examples of how old the practice of letter substitution really is.
The cipher is trivially breakable by modern standards. Because it is a monoalphabetic substitution with a fixed mapping, frequency analysis defeats it immediately. If you have enough ciphertext, the letter frequencies will match the underlying language's distribution, just with the letters swapped. William Friedman's work on frequency analysis for the US Army in the 1930s and 1940s formalized the techniques that make any monoalphabetic substitution cipher, including Atbash, straightforward to crack. You can test this yourself with the Atbash cipher tool, which applies the full reversal mapping to any input text.
Brown gets the history right. He correctly identifies Atbash as a Hebrew cipher, correctly describes the reversal mechanism, and correctly places it in antiquity. Where he takes liberty is in implying that Atbash was some kind of closely guarded secret. It was not. The mapping is deterministic and publicly known. The "security" of Atbash was obscurity, not mathematical strength.
The anagram clues in the book are not cryptography, but they are worth discussing because many readers conflate them with ciphers.
An anagram is a permutation of letters with no key and no algorithm beyond rearrangement. "So dark the con of man" rearranges to "Madonna of the Rocks" because the two phrases share the same multiset of letters. There is no decryption process. You solve it by recognizing the target phrase, which means the puzzle is really a test of cultural knowledge, not cryptanalytic skill.
The Fibonacci sequence as a bank code is similarly a recognition test. The Fibonacci sequence is defined by the recurrence F(n) = F(n-1) + F(n-2), with F(0) = 0 and F(1) = 1. The sequence begins 0, 1, 1, 2, 3, 5, 8, 13, 21, 34. Brown scrambles the first ten digits and uses them as a bank account number. Once you identify the digits as Fibonacci numbers, you can reorder them. But there is no cryptographic operation involved. No key, no ciphertext, no plaintext distinction.
This is worth stating plainly because it affects how people think about puzzles versus ciphers. A cipher transforms plaintext into ciphertext using an algorithm and (usually) a key. An anagram or a number sequence puzzle does not meet that definition. Both can be entertaining plot devices. Neither is cryptography. The Caesar cipher tool demonstrates an actual keyed substitution, where the shift value functions as the key and different keys produce different ciphertexts. That is the distinction that matters.
The biggest historical fabrication in The Da Vinci Code is the Priory of Sion, the secret society that Brown presents as a centuries-old organization guarding the truth about Jesus and Mary Magdalene.
The Priory of Sion was a fabrication. Pierre Plantard, a French draftsman, created the organization in 1956 and registered it as a social club in France. In the 1960s and 1970s, Plantard and his associate Philippe de Cherisey produced a set of forged documents, the so-called "Dossiers Secrets," which they deposited in the Bibliotheque Nationale in Paris. These documents claimed the Priory of Sion had existed since 1099 and had been led by a succession of Grand Masters including Leonardo da Vinci, Isaac Newton, and Victor Hugo.
The hoax was exposed in a French court in 1993. Plantard was ordered to testify under oath during a trial involving Roger-Patrice Pelat, a close friend of then-president Francois Mitterrand. Under questioning, Plantard admitted he had fabricated the Priory of Sion documents and the list of Grand Masters. He had never been a significant figure in any historical organization. The Wikipedia article on Pierre Plantard documents the court proceedings and the researchers, including Michael Baigent, Richard Leigh, and Henry Lincoln, who initially popularized the Priory myth in their 1982 book The Holy Blood and the Holy Grail, before the hoax was definitively exposed.
Brown used the Priory of Sion as a central plot device and stated in a prefatory "Fact" page that the organization was real. This was technically true in the narrow sense that Plantard had registered an organization by that name. But the historical claims Brown attributes to it, the Grand Master lineage, the guardianship of a secret bloodline, are fabricated. The "Fact" page blurred the line between the real registration and the invented history, which misled many readers.
The cryptex, a fictional self-destructing container for secret messages, is also not real. That device gets its own separate analysis, but the short version is that Leonardo da Vinci never invented anything resembling it, and the name "cryptex" was coined by Brown himself.
Whatever its historical inaccuracies, The Da Vinci Code did something that few novels manage: it made a broad audience curious about classical ciphers.
After the book's 2003 publication and the 2006 film adaptation, traffic to cryptography educational sites increased noticeably. The Wikipedia article on The Da Vinci Code notes the book's cultural impact, and the Kryptos sculpture at CIA headquarters, referenced on the book jacket, became a public topic of discussion. Kryptos is a real, unsolved cipher (partially solved in 1999 by Jim Gillogly, with remaining sections still undecrypted as of 2026). The attention Brown brought to Kryptos helped sustain a community of amateur codebreakers who continue working on it.
The book also popularized the Atbash cipher specifically. Before 2003, Atbash was known mainly to biblical scholars and cryptography students. After 2003, it became a staple of puzzle hunts, escape rooms, and CTF challenges. The cipher's simplicity (no key, fixed mapping, instant to apply) makes it ideal for beginner-level puzzles. If you have done an escape room with a cipher clue, there is a decent chance it was Atbash or Caesar.
The downside is that the book blurred the line between real cryptography and conspiracy fiction. Readers who took the "Fact" page at face value came away believing that the Priory of Sion was a real secret society with a documented history, that Leonardo da Vinci embedded coded messages in his paintings as part of a secret tradition, and that the Catholic Church suppressed this information. None of those claims hold up under scrutiny. The real cryptography in the book, Atbash, is the part that checks out. The fictional parts are the conspiracy framework around it.
For anyone who got into cryptography through The Da Vinci Code, the natural next step is to learn the actual cryptanalysis that breaks ciphers like Atbash. Frequency analysis, the Kasiski examination for polyalphabetic ciphers, and the Index of Coincidence are the real tools of the trade. The Vigenere cipher tool is a good starting point for understanding polyalphabetic substitution, which is the next step up from Atbash in complexity and the cipher that was historically called "unbreakable" before Babbage and Kasiski proved otherwise.
Yes. The Atbash cipher is a real Hebrew substitution cipher used in the Bible (Jeremiah 25:26 and 51:41). It reverses the alphabet so A maps to Z, B maps to Y, and so on. Dan Brown's description of it is accurate. It is a monoalphabetic substitution cipher with no key, breakable by frequency analysis.
No. The Priory of Sion was fabricated by Pierre Plantard in 1956. He forged documents (the Dossiers Secrets) claiming the organization dated to 1099 and had Grand Masters including Leonardo da Vinci. Plantard admitted the forgery under oath in a 1993 French court case. The historical claims in The Da Vinci Code about the Priory are fiction.
There is no evidence that Leonardo da Vinci embedded cryptographic messages in his paintings. Art historians have studied his work extensively. The claims in The Da Vinci Code about hidden codes in The Last Supper and Madonna of the Rocks are fictional plot devices, not established art history.
The Fibonacci sequence in the book is used as a bank account code, not a cipher. The first ten Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, 21) are scrambled and used as a numeric password. This is a recognition puzzle, not encryption. There is no key and no decryption algorithm.
No. The cryptex is a fictional device invented by Dan Brown. There is no evidence Leonardo da Vinci created anything like it. The name is a portmanteau of 'cryptology' and 'codex.' The combination-lock mechanism is real, but the vinegar self-destruct is chemically implausible.
The Atbash Cipher: 2,500-Year-Old Encryption Still Used in Puzzles
The Atbash cipher is 2,500 years old, appears in the Hebrew Bible, and is self-inverse. It has no key space and zero security. Here is why it still matters.
How the Vigenere Cipher Works, and Why It Was Called Unbreakable
Understand how the Vigenere cipher uses a repeating key to defeat simple frequency analysis, and learn why the Kasiski examination breaks it anyway.