The Siemens and Halske T52, also known as the Geheimfernschreiber ("secret teleprinter"), or Schlüsselfernschreibmaschine (SFM), was a World War II German teleprinter cipher machine. The machine and its traffic were codenamed Sturgeon by British cryptanalysts.
While the Enigma machine was generally used by field units, the T52 was an online machine used by Luftwaffe and German Navy units, which could support the heavy machine, teletypewriter and attendant fixed circuits. It fulfilled a similar role to the Lorenz SZ 40/42 machine in the German Army.
The British cryptanalysts of Bletchley Park codenamed the German teleprinter ciphers Fish, with individual cipher-systems being given further codenames: just as the T52 was called Sturgeon, the Lorenz machine was codenamed Tunny.
The teleprinters of the day emitted each character as five parallel bits on five lines, typically encoded in the Baudot code or something similar. The T52 had ten pinwheels, which were stepped in a complex nonlinear way, based in later models on their positions from various delays in the past, but in such a way that they could never stall. Each of the five plaintext bits was then XORed with the XOR sum of 3 taps from the pinwheels, and then cyclically adjacent pairs of plaintext bits were swapped or not, according to XOR sums of three (different) output bits. The numbers of pins on all the wheels were coprime, and the triplets of bits that controlled each XOR or swap were selectable through a plugboard.
This produced a much more complex cipher than the Lorenz machine, and also means that the T52 is not just a pseudorandom number generator-and-XOR cipher. For example, if a cipher clerk erred and sent two different messages using exactly the same settings — a depth of two in Bletchley jargon — this could be detected statistically but was not immediately and trivially solvable as it would be with the Lorenz.
There were several (mostly incompatible) versions of the T52: the T52a and T52b (which differed only in their electrical noise suppression), T52c, T52d and T52e. While the T52a/b and T52c were cryptologically weak, the last two were more advanced devices; the movement of the wheels was intermittent, the decision on whether or not to advance them being controlled by logic circuits which took as input data from the wheels themselves.
In addition, a number of conceptual flaws (including very subtle ones) had been eliminated. One such flaw was the ability to reset the keystream to a fixed point, which led to key reuse by undisciplined machine operators.
Following the occupation of Denmark and Norway the Germans started to use a teleprinter circuit which ran through Sweden. The Swedes immediately tapped the line, in May 1940, and the mathematician and cryptographer Arne Beurling cracked the two earliest models in two weeks, using just pen and paper. The Swedes then read traffic in the system for most of the war, not only between Berlin and Oslo, but also between Germany and the German forces in Finland, and of course the German embassy in Stockholm.
The British at Bletchley Park later also broke into Sturgeon, although they did not break it as regularly as they broke Enigma or Tunny. This was partly because the T52 was by far the most complex cipher of the three, but also because the Luftwaffe very often retransmitted Sturgeon messages using easier-to-attack (or already broken) ciphers; thus, attacking Sturgeon was not the most economical way to get the plaintext.
The British first detected T52 traffic in summer and autumn of 1942. One link was between Sicily and Libya, codenamed "Sturgeon", and another from the Aegean to Sicily, codenamed "Mackerel". Operators of both links were in the habit of enciphering several messages with the same machine settings, producing large numbers of depths. These depths were analysed by Michael Crum.