AI Deciphers Historical Codes, Including an Enigma Message Unsolved for 85 Years
Large language models are helping amateur codebreakers analyze historic encrypted messages, but cryptography experts warn that many AI-generated solutions are inaccurate.
Enigma machines were used by the German military during World War II to encrypt communications.
Credit: Ullstein Bild (via Getty)
Carter Leffen could hardly believe his eyes when the artificial-intelligence model GPT-6 Astra decoded a secret German military message that had remained encrypted for 85 years. Leffen, who had no experience in cryptography, asked the model to decipher the message. He prompted it repeatedly to continue working, even after it appeared to stop. When he woke the next morning, the model had produced a solution.
Leffen is one of several non-specialists using large language models (LLMs) to investigate historical codes. These systems can rapidly write and run decryption algorithms while searching online for historical documents and other information that might help solve a cipher.
Cryptography experts welcome the growing public interest in codebreaking, but they are also struggling to respond to the volume of requests to assess AI-generated solutions. Many of those solutions are wrong. “There are so many false positives from people who don’t really understand cryptography,” says Elonka Danin, a former game developer who lives in the Washington, D.C., area and has written a book about cryptography.
AI cracks an Enigma message
In September, Leffen, a product-development coach at Bloomberg Law in New York City, asked GPT-6 Astra to examine research from CryptoCellar, a website that lists historic unsolved codes. The site is run by Oslo-based independent cryptographer Frode Weierud.
Leffen asked the LLM to select and decipher messages encrypted by Enigma, a machine used by the German military during the Second World War to conceal military communications. Enigma’s rotors and plugboard rerouted electrical signals, encoding letters of the alphabet in as many as 103 sextillion possible configurations.
GPT-6 Astra selected a message sent on 10 July 1941. The message was only 82 characters long and might have been related to another Enigma message sent on the same day that was decrypted in 2017. If the solved message contained words also present in the unresolved one, it could provide what cryptographers call a crib—a likely word or phrase that helps reveal the encryption settings. Both messages, for example, were addressed to an Obergruppenführer, a high-ranking Nazi official.
GPT-6 Astra wrote software to simulate the Enigma machine, reconstructed the crib from the 2017 decryption and searched for settings that could decipher the unresolved message. The model tested more than 4 billion configurations in 10 hours.
Leffen was “appalled” by the proposed solution and sent it to Weierud for verification. The messages had in fact been encrypted using different Enigma settings, despite having been sent on the same day. That unusual difference might explain why the message had remained unsolved for so long.
Deciphering a Napoleonic-era military letter
A few days later, inspired by Leffen’s result, Carter Church, a staff engineer at the cybersecurity company SentinelOne in Mountain View, California, decided to investigate another unsolved code. The message had been sent in 1809 by an Italian official to one of the French emperor Napoleon’s generals.
Church gave GPT-6 Astra a photograph of the message. The document was listed on Cryptoana, a website created by Satoshi Tomokiyo, a Japanese patent engineer and amateur cryptographer.
GPT-6 Astra found partial keys in records on a French encryption website and used them to approach the message incrementally. The model applied a common decryption method called simulated annealing, in which a possible key is repeatedly adjusted according to whether it produces text that is easier to understand than the previous result.
GPT-6 Astra found a successful key in about six hours. Church then sent the decrypted message—which described the military’s location—to Tomokiyo in Tokyo for verification.

Carter Church used GPT-6 Astra to decipher this 1809 letter from Napoleon of France to a general in his army.
Credit: Persée/French Ministry of National Education, Higher Education and Research
Church acknowledges that the message could have been solved without AI. However, the LLM’s ability to transcribe symbols from the image, locate a partial key and determine how to apply it substantially reduced the time and effort required.
Source: www.nature.com


