Over the course of her 19 years in captivity, Mary, Queen of Scots, wrote thousands of letters to ambassadors, government officials, fellow monarchs and conspirators alike. Most of these missives had the same underlying goal: securing the deposed Scottish queen’s freedom. After losing her throne in 1567, Mary had fled to England, hoping to find refuge at her cousin Elizabeth I’s court. (Mary’s paternal grandmother, Margaret Tudor, was the sister of Elizabeth’s father, Henry VIII.) Instead, the English queen imprisoned Mary, keeping her under house arrest for nearly two decades before ordering her execution in 1587.

Mary’s letters have long fascinated scholars and the public, providing a glimpse into her relentless efforts to secure her release. But the former queen’s correspondence often raises more questions than it answers, in part because Mary took extensive steps to hide her messages from the prying eyes of Elizabeth’s spies. In addition to folding the pages with a technique known as letterlocking, she employed ciphers and codes of varying complexity.

Ciphers used by Mary, Queen of Scots
Page of ciphers used by Mary, Queen of Scots, circa 1586  National Archives
Francois Clouet portrait of Mary, Queen of Scots
A portrait of Mary as a teenager in France Public domain via Wikimedia Commons

More than 400 years after Mary’s death, a chance discovery by a trio of code breakers is offering new insights into the queen’s final years. As the researchers write in the journal Cryptologia, they originally decided to examine a cache of coded notes housed at the National Library of France as part of a broader push to “locate, digitize, transcribe, decipher and analyze” historic ciphers. Those pages turned out to be 57 of Mary’s encrypted letters, the majority of which were sent to Michel de Castelnau, the French ambassador to England, between 1578 and 1584. All but seven were previously thought to be lost.

Interspersed with a collection of early 16th-century Italian papers, the documents were written in mysterious symbols that offered no clues “as to their sender, recipients or date,” lead author George Lasry, a computer scientist and cryptographer based in Israel, tells Smithsonian magazine. It was only when the scholars spotted the word “Walsingham”—the last name of Elizabeth’s spymaster, Francis Walsingham—that they realized the letters’ significance.

“This was the ‘bingo moment,’” Lasry says. “We were very excited.”

Before getting too excited, the trio set out to confirm whether the letters were already known to historians. While they found copies of a few in British archives, “50 or so are new to historians—and a real gold mine for them,” says Lasry. In total, the letters contain 50,000 words of deciphered material.

A Nicholas Hilliard portrait of Mary, Queen of Scots, in captivity
A Nicholas Hilliard portrait of Mary, Queen of Scots, in captivity Public domain via Wikimedia Commons

In a statement, John Guy, author of the 2004 biography that inspired Josie Rourke’s 2018 film about Mary, says, “This is the most important new find on Mary, Queen of Scots, for 100 years. I’d always wondered if de Castelnau’s originals could turn up one day, buried in the [National Library of France] or perhaps somewhere else, unidentified because of the ciphering. And now they have.”


To decrypt the letters, Lasry worked with Norbert Biermann, a German pianist, and Satoshi Tomokiyo, a Japanese physicist and patents expert. First, the men transcribed the documents, rendering the 150,000 symbols readable by a computer. Then they employed a hill-climbing algorithm, in which a computer tries out different cipher keys, making small changes to high-scoring keys before attempting to decipher the text again.

Put simply, codes involve simple substitutions, with specific symbols standing in for letters, numbers or words. Ciphers are more complex, using algorithms to transform messages into seemingly random strings of symbols. Mary’s letters fall under this second category.

One of the decrypted letters
One of the decrypted letters Lasry et al. / Cryptologia, 2023

Starting from scratch, the hill-climbing algorithm managed to decrypt about 30 percent of the original text. But the remaining 70 percent had to be deciphered by hand, using a process “somewhat analogous to solving a large crossword puzzle,” according to the study. The encryption turned out to be a homophonic cipher, in which each letter of the alphabet can be encoded in several different ways. Mary also used a number of dedicated symbols representing commonly cited words and people. An elongated “H,” for example, denoted the Earl of Shrewsbury, an English nobleman who served as the queen’s custodian during her time in captivity.

The researchers’ breakthroughs arrived in stages. Early on, they realized the papers were written in French, not Italian as the library’s catalog indicated. Phrases like “ma liberté” (“my freedom”) and “mon fils” (“my son”) pointed to the writer’s identity as a mother in captivity. And the mention of Walsingham, a key figure in Mary’s imprisonment, cemented the men’s growing suspicions about the letter writer’s identity.

Next, the trio cross-referenced the decrypted text with papers housed at the British Library and other archives in the United Kingdom. That’s when they found duplicates of the seven letters already known to historians, all written in 1583 and 1584. The timeline makes sense: During this period, Walsingham was obtaining copies of Mary’s letters from a mole in the French Embassy.

“It would seem that the leak from the embassy was quite effective and comprehensive,” the authors write in the paper.

Symbols used by Mary, Queen of Scots, in her encrypted messages to the French ambassador
Symbols used by Mary, Queen of Scots, in her encrypted messages to the French ambassador Lasry et al. / Cryptologia, 2023
Symbols used by Mary, Queen of Scots, in her encrypted messages to the French ambassador
Symbols used by Mary, Queen of Scots, in her encrypted messages to the French ambassador Lasry et al. / Cryptologia, 2023

As Lasry explains, “There was not too much incentive for scholars to try to crack the ciphers, as there was no way to know in advance that their contents [were] so important.” He and his colleagues took “a different approach. We were not looking specifically for ciphers from Mary. We were just looking for ciphers … and when we find such ciphers, we take great pleasure in cracking them.”


The rediscovered letters address “a wide range of topics [that] will be of immense interest to historians,” says Lasry. Mentioning more than 120 individuals, they add “color to many events,” from the doomed marriage negotiations between Elizabeth and Francis, Duke of Anjou, to the capture of Mary’s son, James VI of Scotland (and the future James I of England), in 1582.

The trio’s paper includes summaries of all 57 letters, as well as the decrypted and translated text of a select few missives. Elizabeth is a recurring figure in these notes, with Mary continually reminding de Castelnau to petition the queen on her behalf. In an April 16, 1583, letter tentatively translated by the code breakers, Mary writes, “I cannot thank you enough for the care, vigilance and entirely good affection with which I see that you embrace everything that concerns me, and I beg you to continue to do so more strongly than ever, especially for my said release to which I see the queen of England quite inclined.”

Elizabeth I
Elizabeth I Public domain via Wikimedia Commons
Francis Walsingham, Elizabeth I's spymaster
Francis Walsingham, Elizabeth I's spymaster Public domain via Wikimedia Commons

Enthroned as Scotland’s queen at just six days old, Mary spent the early years of her reign in France, where she was raised alongside her future husband, Francis II. She briefly served as queen of both Scotland and France but lost the latter title after Francis’ death in 1560. Returning to her home country, Mary found herself torn between rival Scottish factions, a Catholic woman ruler in a Protestant kingdom dominated by men.

Unlike her cousin Elizabeth, who famously refused to marry, preferring to remain a supposedly virgin queen, Mary wed a total of three times. Her second husband, Henry Stuart, Lord Darnley, proved to be a highly unsuitable match, exhibiting a lust for power that likely led to his death under highly suspicious circumstances in 1567. Three months later, Mary wed James Hepburn, Earl of Bothwell, the man who’d been accused of—and acquitted of in a legally suspect trial—Darnley’s murder. Understandably shocked by Mary’s association with her husband’s presumed killer, the queen’s courtiers and subjects turned against her, forcing her to abdicate in favor of her infant son, James.

Though Mary attempted to reclaim her throne in May 1568, her efforts were unsuccessful. She fled to England, hoping to find shelter and support at her cousin’s court. To Mary’s surprise, Elizabeth not only refused to meet her face to face, but also detained her for years on end. A Protestant queen with a tenuous claim to the throne (she was declared a bastard after the execution of her mother, Anne Boleyn, in 1536), Elizabeth feared being replaced by Mary, a Catholic who many believed should wear the crown in her place.

Despite Mary’s status as an anointed queen, she was essentially treated like Elizabeth’s subject. The problem, Janet Dickinson, a historian at the University of Oxford, told Smithsonian in 2018, was Mary’s lack of leverage. She enjoyed a slim amount of support from her relatives in France, but her former mother-in-law, Catherine de’ Medici, didn’t want to take on the burden of supporting a fallen queen. Returning to Scotland was also impossible, as James’ reign had been officially acknowledged by Elizabeth. Allowing Mary to simply traverse Europe freely was out of the question, too.

Drawing of the trial of Mary, Queen of Scots
Drawing of Mary's trial on charges of treason in October 1586 Public domain via Wikimedia Commons
Drawing of the execution of Mary, Queen of Scots, on February 8, 1587
Drawing of the execution of Mary, Queen of Scots, on February 8, 1587 Public domain via Wikimedia Commons

In the end, she had little choice but to wait for her son to grow up and intervene on her behalf. Instead, James “actively chooses not to, so in a sense they’re all stuck in a completely impossible situation,” Dickinson said. “Everything’s a big gray area … and nobody really is inclined to help.”

In 1586, Mary was implicated in a Catholic plot led by Anthony Babington. Playing directly into Elizabeth’s long-held fears, Babington conspired to assassinate the English queen and replace her with Mary. Though Babington and Mary had exchanged coded messages, she denied ever authorizing Elizabeth’s assassination. Still, writes Guy in his 2004 biography, this argument was based mainly on semantics, as Mary, deeming herself an independent queen, had appealed for foreign aid to assist in her quest for liberation, thereby framing Elizabeth’s death as “no more than a providential incident in her legitimate struggle to regain her rights.” Mary was found guilty of treason and beheaded at Fotheringhay Castle on February 8, 1587.

Get the latest History stories in your inbox?

Click to visit our Privacy Statement.