[Next] [Up] [Previous] [Index]

The Hagelin Machines

Although the Swiss firm founded by Boris Hagelin has manufactured, and continues to manufacture, many kinds of cipher machine, the words "Hagelin machine" will normally inspire thoughts of their unique lug and pin based machines.

The basic principle of a Hagelin lug and pin machine is easy enough to describe. In the C-38, used by the U.S. Army as the M-209, six pinwheels, with 17, 19, 21, 23, 25, and 26 positions on them, can be set by the user with an arbitrary series of pins that are active. For every letter enciphered, all the pinwheels rotate one space.

The combination of active and inactive pins is presented to a cage with 27 sliding bars. Each bar has two sliding lugs on it, which can be placed either in a position where it is inactive, or in a position corresponding to any of the pinwheels, so that it will slide the bar to the left, if the pin currently presented by that pinwheel is active.

The number of lugs sticking out rotates the cipher alphabet against the plaintext alphabet. The two alphabets used are just the regular alphabet, and the alphabet in reverse order, from Z back to A. This meant that encipherment was reciprocal, although the machine still had a switch to select encipherment or decipherment: this determined if the machine printed its output in five letter groups, or if it translated one letter, chosen by the user, to a space.

The C-52, a postwar version of the Hagelin lug and pin machine, added an extra five sliding bars to the cage that, instead of moving the cipher alphabet, caused the stepping of the pinwheels to be irregular. The first pinwheel always moved, but the remaining five pinwheels only moved when their corresponding bars were slid to the left. The six pinwheels were labelled A, B, C, D, E, and F from left to right; bar 1 controlled pinwheel B, bar 2 pinwheel C, and so on.

Also, on the C-52 the lugs could be moved from bar to bar, and the six pinwheels were chosen from a set with lengths 25, 26, 29, 31, 34, 37, 38, 41, 42, 43, 46, and 47. Using the pinwheels with lengths 34, 38, 42, 46, 25, and 26 allowed one to achieve compatibility with the C-36: provided one also turned off the irregular pinwheel stepping feature.

The alphabet always started from its normal position, instead of the position last used, before being rotated by the projecting slide bars. This was perhaps the machine's main weakness, as it made attacks based on frequency counts of displacements possible, but it was perhaps unavoidable, since there was always a slight possibility of occasional mechanical errors. Particularly as the machines were often used on battlefields.

In setting the lugs on the sliding bars, it was important to put many lugs for some pinwheels, and few lugs for others, so as to get an even distribution of displacements: basically, although some bars with two lugs active were desirable for irregularity, the arrangement needs to approximate a binary coding of the active pins - that is, one pinwheel might have only one lug facing it, another two, another four, and another about eight, and another about thirteen or so.

For the C-52, in setting up lugs on the first five bars, it was important to ensure frequent movement of the pinwheels.

I have just recently learned of a machine derived from the Hagelin machine that was devised for the Abwehr late in World War II, from news items concerning one specimen of that rare machine which went on display at Bletchley Park after a reunion held there in early September of 2012.

The news stories referred to the machine as the SGZ41. In fact, apparently its designation was the SG-41, although a variant, the SG-41Z, also existed; but this had a numeric keyboard, as it was used to encipher weather reports, and the device pictured in the news stories had an alphabetic keyboard.

Some web sites have claimed that it is not known if this device was more secure than ordinary Hagelin machines. However, it is not the case that its workings are still secret, or, at least, if not classified, not readily available.

A public information brochure, "German Cipher Machines of World War II", made available by the National Security Agency, and dated 2003, gives a technical description of the machine. (This was also the source for my description of the SG-39.)

The machine had six pinwheels, with relatively prime periods. The size of the wheels is not given; photographs suggest they may have been something like 19, 23, 25, 26, 27 and 29, for example.

The cage may not have been resettable: it is noted that the number of lugs corresponding to the first five pinwheels were 1, 2, 4, 8, and 10 respectively.

The sixth pinwheel instead controlled inverting the displacement generated by the other five pinwheels; it was complemented by being subtracted from 25. Thus, for example, a displacement of 11 could be made by the following pinwheel outputs:

 1  2  4  8 10 KI
 1  0  0  0  1  0
 1  1  0  1  0  0
 0  0  1  0  1  1
 0  1  1  1  0  1

the inversion of the displacement being called a "kick".

Instead of the pinwheels moving uniformly, however, they had a variable motion. An active pin at one position engaged the lugs, or, in the case of the sixth pinwheel, caused the "kick", inverting the lug displacements.

An active pin in another position, the "motion index position", on one pinwheel would make the next pinwheel move two steps instead of one step, but only when the pin in the motion index position on the last pinwheel, pinwheel 6, was active.

However, in addition, pinwheel 6 could move an extra step even if the pin in its motion index position, allowing extra stepping in general, was not active. But the account here is unclear, due to a typo, as it also seems to state that it is the motion index pin for wheel 6 that controls this stepping.

[Next] [Up] [Previous] [Index]

Chapter Start
Skip to Next Section
Table of Contents
Home Page