In 1587, hours before her beheading, Mary, Queen of Scots, sent a letter to her brother-in-law Henry III, King of France. But she didn't just sign it and send it off. She folded the paper repeatedly, cut out a piece of the page and left it dangling. She used that strand of paper to sew the letter tight with locking stitches.

In an era before sealed envelopes, this technique, now called letterlocking, was as important for deterring snoops as encryption is to e-mail inboxes today. Although this art form faded in the 1830s with the advent of mass-produced envelopes, it has attracted renewed attention from scholars. But they have faced a problem: How do you look at the contents of such locked letters without permanently damaging priceless bits of history?

Recently, a team of 11 scientists and scholars at the Massachusetts Institute of Technology and other institutions disclosed their development of a virtual-reality technique that lets them perform this delicate task without tearing up the contents of historical archives.

In the journal Nature Communications, the team tells of virtually opening four undelivered letters written from 1680 and 1706. The dispatches had ended up in a wooden postal trunk in The Hague. Known as the Brienne Collection, the box contains 3,148 items, including 577 letters that were never unlocked.

The new technique could open a window into the long history of communications security. And by unlocking private intimacies, it could aid researchers studying stories concealed in fragile pages found in archives all over the world.

"Let's start virtually unfolding" the locked letters, said Daniel S. Smith, a team member at King's College London.

In an interview, Jana Dambrogio, the study's lead author and a conservator at the MIT Libraries, said that learning of the trove's existence inspired her to see if more technologically inclined colleagues could find a way to digitally open the locked letters. At the time, in 2014, scholars could read and study such letters only by cutting them open, which often damaged the documents and obscured or eliminated clues as to how they had been secured.

"We really need to keep the originals," Dambrogio said. "You can keep learning from them, especially if you keep the locked packets closed."

The old letters were protected from prying eyes when the sheets of writing paper were carefully folded to become their own secure enclosures.

The first step of their digital opening is to scan a target letter with an advanced X-ray machine. The resulting 3-D image — much like a medical scan — reveals the letter's internal configuration. A computer then analyzes the image to undo the folds and, almost magically, turn the layers into a flat sheet, revealing handwritten text.

The team translated one of the digitally opened letters from the Brienne Collection. It was dated July 31, 1697, and sent from Lille, France, to a French merchant in The Hague. It turned out to be a request for a certified copy of a death notice.

More analyses of the Brienne Collection, the paper added, may enrich studies not only of postal networks in early modern Europe but of the region's politics, religion, music, drama and patterns of migration.