The Lorenz SZ42 - known as Hitler's "unbreakable" cipher machine - is on loan to the National Museum of Computing at Bletchley Park.
Staff launched an appeal for help to recreate the vital component to allow visitors to see it in working order.
Messages from Lorenz were routinely intercepted during World War Two.
The machine was used by German forces in Norway and seized by the Norwegian secret services after the war.
It has been given to the UK on long-term loan by the Norwegian Armed Forces Museum.
It is thought about 200 were in operation during the war, but only four still exist.
The model has a number of inner components missing - including an all-important working motor.
Now, a team of engineers from the Government Communications Centre (HMGCC) has stepped in to recreate the motor using 3D printing technology.
The museum's John Whetter, who helped secure the loan of the Lorenz SZ42, said: "The HMGCC team will take three-dimensional images of an existing Lorenz motor and then reconstruct it using 3D printing techniques.
"Externally, the motor will be almost indistinguishable from an original."
The motor will allow staff to demonstrate how Bletchley Park was able to intercept German commands using the British codebreaking machine, Colossus.
The groundbreaking intelligence work carried out at Bletchley Park during World War Two was credited with bringing forward the end of the conflict.
A HMGCC spokesman said: "The wartime work at Bletchley Park, including breaking the Lorenz cipher, was instrumental in the birth of modern computing and the development of what we now call cyber security."
A team of engineers will use 3D printing technology to reconstruct the missing motor of a rare wartime German code machine.