Virtual SG-41 project brings Nazi cipher machine to life in the browser

Martin Gillow's 3D recreation lets users explore would-be Enigma successor's mechanics and enciphering logic online

by · The Register

An enthusiast has built a digital 3D model of the SG-41 cipher machine, replete with wheels, levers, and stepping logic, accessible via a browser.

Martin Gillow, the person behind the project, describes the recreation as "part digital preservation, part engineering archaeology, and part 'how on earth did this thing even work?'"

3D model of the SG-41

The SG-41 was first produced in Germany during the Second World War. Its full name was the Schlüsselgerät 41, and the hope was that it could succeed the famous Enigma machine. Nicknamed "the Hitler Mill" for its hand crank on the side, the machine could print both plaintext and ciphertext of a message onto a pair of paper tapes.

Gillow told The Register that his inspiration came following a visit to Bletchley Park and The National Museum of Computing, which hosts a rebuild of the Colossus computer. Gillow took the source code for the old Colossus simulator, which required Internet Explorer, and in 2016 developed the Virtual Colossus, then another cipher machine, Virtual Lorenz in 2017.

Gillow went on to create digital versions of other machines before taking on the challenge of the SG-41 at the end of 2024. He began with a 3D scan of the machine, helpfully provided by the Deutsches Museum. He also gives credit to the team at Crypto Museum who "did a huge amount working out the detail of how the machine enciphered, which was a great way to compare that the physical workings of the components I was modeling actually matched with the results from a real machine."

"I'm not sure that anyone before has dug quite as deep into the workings of this machine as I've had to do to be able to duplicate everything in detail."

In 2025, Gillow was invited to view an SG-41 held by GCHQ. As well as benefiting from seing some of the components he was having difficulty understanding, "it was really great to see how close my simulation had already got to their real SG-41 and to talk to them about my work!" Gillow's project is an impressive and educational digital simulation of the machine, and it is fascinating to see how the components worked as part of the process. What it isn't is a full physics rendition of the device. "The gears aren't actually turning each other," explained Gillow, "and the levers aren't really following the outside of the cams."

"But they're each turning correctly based on the number of teeth, or, in the case of the cams, each few degrees had to be mapped out so that the levers correctly followed the shape of the cam."

"This means that the final enciphering is being done by calculating how many of the levers on the rotating cage are being pushed to the correct position to turn the print wheels on that many steps!"

As with any digital project, longevity is a challenge. After all, the Virtual Colossus sprang from a simulation that required obsolete technology. There is a certain irony in equipment that has endured for decades still being accessible while modern simulations fall by the wayside.

Gillow told us: "The longevity of these simulations has been very much on my mind as I've got to ten years of running this project. My very next task, now that the SG-41 is completed, is to plan for that exactly."

"I would like to not only preserve these machines for future users and researchers, but also, many of the other cryptography sites that are currently available. There is a lot of information and photos on many sites, but I realise that the current custodians of these sites (myself included) are not getting any younger, and like the original Virtual Colossus, I really want these to continue to be available in future."

"Once a user no longer keeps paying for the upkeep of a site, the data can just disappear and sometimes even sites like web.archive.org do not store all the information, especially when it comes to larger files or animations."

Gillow's plan is to create a repository of his and others' (with permission) machine simulations on a site such as Zenodo, which stashes data in CERN's datacenter, so it should be safe for as long as CERN exists.

The use of tools such as Blender to create the 3D models will also help to keep things accessible in years to come.

As for the future, Gillow told us he plans to keep working through the historic devices. "I don't plan to stop creating simulations any time soon so the Virtual Colossus project is not yet completed."

"There are many more interesting machines that I can research and simulate." ®