
Enigma machines were used by the German armed forces to encrypt communications during the Second World War.Credit: Ullstein Bild via Getty
Carter Leffen couldn’t believe his eyes when the artificial-intelligence model GPT-6 Astra decoded a secret German army message that had been encrypted for 85 years. Leffen, who has no cryptography experience, asked the model to decipher the message, nudged it a few times to keep thinking and encouraged it to keep working when he went to bed. Sure enough, when he woke up in the morning, it had a solution.
Leffen is one of many non-experts who are now using large language models (LLMs) to break historical codes. Their efforts harness the LLMs’ ability to rapidly deploy decryption algorithms while also searching the Internet for extra historical documents or information that might help.
Cryptography specialists are thrilled at the surge in interest in codebreaking — but they are also being overwhelmed by a deluge of requests to validate AI solutions, which can often be incorrect. “There are so many false positives that are coming in from people who don’t really understand cryptanalysis,” says Elonka Dunin, a retired game developer in the Washington DC area who has written books on cryptography.
Cracked codes
In September, Leffen, a product development coach at Bloomberg Law in New York City, asked GPT-6 Astra to scour Crypto Cellar Research, a website listing historical, unsolved ciphers that is run by independent cryptographer Frode Weierud in Oslo. Leffen tasked the LLM with selecting and then decoding a message encrypted by Enigma, a machine used by the German armed forces during the Second World War to hide military communications from enemies. Enigma’s rotors and plugs rerouted electrical signals to encrypt the letters of the alphabet in up to 103 sextillion possible ways.

AI is helping to decode animals’ speech. Will it also let us talk with them?
GPT-6 Astra, developed by the firm OpenAI in San Francisco, California, chose a message sent on 10 July 1941, possibly because it was short — 82 characters — and was potentially related to another Enigma message sent on the same date that had been decoded in 2017. If that already-solved message contained some of the same words as the unsolved one, it could help to ease the decryption, providing what cryptographers call a crib. For instance, both messages might be addressed to “Obergruppenführer”, a high-level Nazi official.
GPT-6 Astra wrote code to simulate an Enigma machine and searched for the settings that would both reproduce the crib from the message solved in 2017 and render the unsolved message comprehensible. In ten hours, the LLM tested more than four billion settings. Leffen was “gobsmacked” by the solution it presented to him and sent it to Weierud for confirmation. It turned out that the message had been encrypted with Enigma settings different from those used on the already-deciphered message, even though they were sent on the same day — this is unusual and might explain why the code went unsolved for so long.
The imitation game
Days later, inspired by Leffen’s success, Carter Church, a staff engineer at cybersecurity company SentinelOne in Mountain View, California, decided to tackle an unsolved cipher sent by an Italian official to one of French emperor Napoleon’s generals in 1809. Church gave GPT-6 Astra a picture of the message, which had been listed on Cryptiana, a website compiled by Japanese patent engineer and hobby cryptographer Satoshi Tomokiyo.
GPT-6 Astra found a partial key among records on a French cryptography website, and tried an incremental approach to tackle the unsolved message. It used a common decoding strategy called simulated annealing, in which a deciphering key is tweaked iteratively according to whether the output is more comprehensible than that from the previous key. GPT-6 Astra hit on a successful key in about six hours, and Church sent the decoded message — which turned out to describe troop locations — to Tomokiyo, based in Tokyo, for verification.

Carter Church used GPT-6 Astra to decode this 1809 letter, intended for a general in the French emperor Napoleon’s army.Credit: Persée/French Ministry of National Education, Higher Education and Research
Church notes that this message could have been solved without AI, but the LLM’s ability to transcribe the symbols in the image, find the partial key and determine how to apply it greatly reduced the time and effort required.
