Hagelin M-209 - The History

The M-209 basic overview and its history

In cryptography, the M-209, designated CSP-1500 by the Navy (C-48 by the manufacturer) is a portable, mechanical cipher machine used by the US military primarily in World War II, though it remained in active use through the Korean War. The M-209 was designed by Swedish cryptographer Boris Hagelin in response to a request for such a portable cipher machine, and was an improvement of an earlier machine, the C-36.

US military M-209 cipher machine
US Army M-209
(Image from www.cryptomuseum.com)

The M-209 is about the size of a lunchbox, in its final form measuring 178 × 140 × 83 mm (3.25 × 5.5 × 7 inches) and weighs around 2.7kg. It represented a brilliant achievement for pre-electronic technology.

Basic operation

Basic operation of the M-209 is relatively straightforward. Six adjustable key wheels on top of the box each display a letter of the alphabet. These six wheels comprise the external key for the machine, providing an initial state, similar to an initialization vector, for the enciphering process.

US military M-209 cipher machine
US Army M-209
(Image from www.cryptomuseum.com)



To encipher a message, the operator sets the key wheels to a random sequence of letters. A cipher-decipher knob on the left side of the machine is set to "Cipher." A dial known as the indicator disk or letter selecctor, also on the left side, is turned to the first letter in the message. This letter is encoded by turning a hand crank or power handle on the right side of the machine; at the end of the cycle, the ciphertext letter is printed onto a paper tape, the key wheels each advance one letter, and the machine is ready for entry of the next character in the message. On the M-209, to indicate spaces between words in the message, the letter "Z" is enciphered, this being a rarely used letter in American English. Repeating the process for the remainder of the message gives a complete ciphertext, which can then be transmitted using Morse code or another method. Since the initial key wheel setting is random, it is also necessary to send those settings to the receiving party; these may also be encrypted using a daily key, or transmitted in the clear.

Printed ciphertext is automatically spaced into groups of five by the M-209 for ease of readability. A letter counter on top of the machine indicated the total number of encoded letters, and could be used as a point of reference if a mistake was made in enciphering or deciphering.

The deciphering procedure is nearly the same as for enciphering; the operator sets the cipher-decipher knob to "decipher", and aligns the key wheels to the same sequence as was used in enciphering. The first letter of the ciphertext is entered via the indicator disk, and the power handle is operated, advancing the key wheels and printing the decoded letter on the paper tape. When the letter "Z" is encountered, a cam causes a blank space to appear in the message, thus reconstituting the original message with spaces. Absent "Z"s can typically be interpreted by the operator, based on context.

An experienced M-209 operator might spend two to four seconds enciphering or deciphering each letter, so operation was relatively fast.

View M-209 Manual

Internal elements

Overview

Inside the casing of the M-209, a much more complicated picture emerges. The six key wheels each have a small movable pin aligned with each letter on the wheel. These pins may each be positioned to the left or right; the positioning of these pins affects the operation of the machine. The left position is inactive, while the right position is active.

Interior view of the M-209
Interior view of the M-209
(Image from www.cryptomuseum.com)

Each key wheel contains a different number of letters, and a correspondingly different number of pins. From left to right, the wheels have:

  • 26 letters, from A to Z
  • 25 letters, from A to Z, excepting W
  • 23 letters, from A to X, excepting W
  • 21 letters, from A to U
  • 19 letters, from A to S
  • 17 letters, from A to Q

This discrepancy is chosen to give the wheel sizes a relatively prime nature; the end result is that the wheels only align the same way once every 26×25×23×21×19×17 = 101,405,850 enciphered letters (also known as the period). Each key wheel is associated with a slanted metal guide arm that is activated by any pins in the "active" position. The positions of the pins on each key wheel comprise the first part of the internal keying mechanism of the M-209.

A US M-209 in use in the field
The M-209 would be carried in a pouch as shown here
(unsure of date or location of image)

Behind the row of six key wheels is a cylindrical drum consisting of 27 horizontal bars. Each drum bar has two movable lugs attached; the lugs can be aligned with any of the six key wheels, or may be placed in one of two "neutral" positions. An active pin causes its guide arm to tilt forward, contacting the drum. The positioning of the lugs comprises the second part of the internal keying mechanism. Owing to the complexity of setting the internal keying mechanism, it was altered relatively infrequently; changing internal keys once a day was common in practice.

When the operator turns the power handle, the cylindrical drum makes a complete revolution through all 27 bars. If a lug on one of the bars contacts the guide arm of an active key wheel, that bar is slid to the left; lugs in neutral positions, or which do not contact a guide arm, do not affect the position of the bar. All bars that are slid to the left comprise a variable-toothed gear, which in turn shifts the letter to be encoded; the shift is equal to the number of bars protruding to the left. The resulting ciphertext letter is printed onto the paper tape.

After the rotation is complete, a retractor pushes the protruding bars back into place. A set of intermediate gears advances the key wheels by one position, and a locking arm latches into the drum to prevent a second encoding until the indicator disk is adjusted for the next letter.

This system allowed the offset to change for each enciphered letter; without this facility, the enciphering scheme would resemble a very insecure Caesar shift cipher.

Pin-and-lug cipher machines in the same series

The C range of small mechanical cipher machines were all of a similar pin-and-lug type and were developed by Boris Hagelin at AB Cryptoteknik in Stockholm in Sweden. Listed here are a few of the machines leading up to the M-209, the number in the title is often related to the year of development (e.g. the C-35 in 1935). These are all mechanical only machines, no battery or mains is required to run them, making them ideal for the battlefront.

Hagelin C-35

The C-35 cipher machine
The C-35 cipher machine

The C-35 is the first mechanical pin-and-lug cipher machine developed by Boris Hagelin and was originally requested by the French Army who wanted a small pocket size cipher machine. It measured 6" x 4.5" x 2" (152.4mm x 114.3mm x 50.8mm) and weighed less than 3 pounds (1.36kg).

At the front of the machine are five pin-wheels (one less than on the M-209 and C-38). Each wheel has a differing number of steps: 25, 23, 21, 19 and 17 which means the missing one is the 27 step wheel. This gives a period of 3,900,225 before the key starts to repeat.

The cage at the back is similar to the later models, but the protruding lugs are fixed in place and cannot be moved by the operator and it has a total of 25 bars.

Hagelin C-36

Interior view of the C-36
Interior view of the C-36
(Image from www.cryptomuseum.com)

The C-36 was very similar to the C-35 having the same five pin-wheels and cage, but having an outer housing & cover and the fixed lugs have a slightly different distribution.

A later model called the C-362 had movable lugs added instead of the fixed ones (more like the C-38 / M-209) plus a number of other changes like the inner lid key being changed to a cross-type rather than a standard "Yale" type key and a longer swing-out handle rather than the compact one.

Hagelin C-37

The Hagelin C-37 was developed around 1937 for the French market (possibly the French Navy). Again, a similar cipher mechanism to its predecessor, the C-36, but is wider than the C-36 and has a several bigrams to the left of each letter on the much larger selector knob which looks like it has numeric characters and some punctuation. It also has a very different set of print wheels. For a couple of images of this machine and more info see Crypto Museum - Hagelin C-37

Hagelin C-38

Interior view of the C-38S
Interior view of the C-38S
(Image from www.rrauction.com)

The C-38 was designed as the successor to the C-36 and was developed at the beginning of World War II. The M-209 (designated the CSP-1500 by the US Navy) was functionally very similar to this machine, with a few changes made to the M-209 to make it easier to operate & manufacture. It measures 178 x 140 x 83 mm and weighs 2.7kg making it possible to fit in a (large) coat pocket.

Exterior view of a C-38S
Exterior view of a C-38S

An additional pin-wheel was added on the left of the existing five in the previous machines, a 26 position wheel with letters A-Z around it's edge. This gives a period of 101,405,850 keys before repeating. The machines in this class seem to have more bars in the cage at the rear, giving a total of 29 in most cases. [Note from Virtual Colossus: The M-209 has only 27 bars & it may be that some models of the C-38 have interchangable/removable bars. If you know more about the totals of the bars on specific models, please let me know!]

There again seem to be several models of the C-38 for specific purposes or for specific customers. The standard model seems to be marked as the C-38S. For the Italian Supermarina (The Italian Navy) during WW2, it seems that there was a C-38M model, but this is extremely rare (if any have survived) and I haven't seen one to know the differences.

One change between the C-38 and the M-209 versions appears to be the letter which is assigned as the space character. On the M-209, this is assigned as the Z character (when in cipher mode, a Z in a cipher message will print normally but when in decipher mode, a resulting deciphered Z letter is printed as a blank space). On the C-38S though, this seems to be set to the letter X rather than Z. (for more information on how this works, see the technical details page)

Below is a list of some of the differences on the C-38 compared to the M-209/CSP-1500

  • The C-38 has an adjustable letter wheel
  • Extra bars on the cage
  • Lockable inner and outer case
  • Some minor mechanical changes including ratchet/pawl on the paper feed and a different arrangement for the letter lock
  • A second button on the top of the inner lid (my guess is to reset the letter count without changing the pin-wheels)
  • A different double-ended tool to change the pins/lugs which was mounted on a clip to the right of the machine rather than in the lid.

The C-38SX

Another version of the C-38S that seems to have been available is the C-38SX. This is similar to the standard C-38S but with an extra option on the cipher/decipher knob marked with an X

The additional X mode is to allow the cipher machine to print the X (space) character while in decipher mode. Therefore the three modes (and their effects) are:

  1. C (Cipher mode) : This mode groups the printed text into groups of 5 letters and will print the cipher letter Z
  2. D (Decipher mode) : This mode no longer groups the text, just printing the deciphered letters. Also, a deciphered X will not be printed but the paper will just space one character
  3. X (X mode) : This mode also doesn't group the text for deciphering, but, when a deciphered X is to be printed, the machine will actually print the X
Exterior view of a C-38SX
Exterior view of a C-38SX
Side view showing the third X option
Side view showing the third X option
Interior View
Interior View
View showing 29 bars on the cage
View showing 29 bars on the cage
The pin/lug tool
The pin/lug tool
The changeable letter selector knob
The changeable letter selector knob

Bletchley Park

Bletchley Park worked on and cracked the Hagelin models, especially of interest was the fact that the Italian SuperMarina was using the C-38.

The below decrypt from an Ultra signal is as it was reported to the Admiralty by the Bletchley Park Naval Section. In the serial, CX/MSS is the standard reporting code for Ultra, meaning the product of the breaking of high-grade Axis ciphers. The rest is particular to naval Ultra. Z means naval Ultra; TP means ‘teleprint’; I means Italian and GM means German Mediterranean; the number refers to the specific decrypt. Thus this signal was compiled from an Italian decrypt, presumably from Hagelin, and a German Enigma decrypt probably from the Porpoise key. Note TOO means Time of Origin, the time the message was handed to the Axis cipher clerk, rather than the time of interception. This decrypt was also separately reported via SCU/SLU channels to army/air commands as ML 1324.

Ultra signal is as reported to the Admiralty by the Bletchley Park Naval Section
Ultra signal is as reported to the Admiralty by the Bletchley Park Naval Section
Document from Bletchley Park Trust - object number D-1655-041

The images below are also from the Bletchley Park Trust and are believed to be rebuilt Y setting books. Thomas Cheetham, a Research Officer at Bletchley park gives the following description.

"Our interpretation is that the 5-digit numbers are indicators referring to page (2 digits) column (1 digit) and row (2 digits) of the key book, and the 6 letters are the associated setting of the rotors in the machine (known as the Y setting). The Italians used the same Y key book for six months, while changing the other settings of the machine (termed W and X), so rebuilding the Y book BP helped identify depths which could be used to determine the W and X settings. One of the files is in alphabetical order to facilitate that process and the other is in number order to match the order of the original Italian key book."

Bletchley Park Hagelin settings books
Bletchley Park Hagelin settings books
Bletchley Park Hagelin settings books
Bletchley Park Hagelin settings books