The HAGELIN cryptographer CX-52.


Table of contents


Introduction

In 1916 the firm A.B. Cryptograph was formed i Stockholm, Sweden in order to exploit the cryptographic inventions of engineer Arvid Gerhard Damm. Initially the firm had economical problems, but the well-known Nobel family showed interest in the firm and took over the financiation in 1920.

In 1922 Mr Boris Hagelin was placed in the firm by the Nobels as trustee. Soon he took an interest in cryptography and started to invent cryptographic machines of his own. One of his designs, the C-36, was used extensively during WWII by the American forces under the name M-209.

Some years after the war, Mr Hagelin moved to Switzerland, and on 15 May 1952 the new firm, Crypto AG, was founded in Zug. One of the first, new constructions made by Mr Hagelin and Crypto AG was the Cryptographer CX-52.


A picture of the machine

Click here to view a picture of the machine: CX52A.JPG


Cryptographic description

The CX-52 uses six pinwheels, each having 47 pins which can be set in either active or inactive positions individually. Each wheel can be set up in over 120,000,000,000,000 ways, but only about half that number constitutes "good" keys. The positions of the pins on the wheels together with the wheel order - the wheels can be arranged in 6!, or 720 different ways - constitutes one of two variable keying elements.
The other, is the arrangement of a series of lugs on a bar drum. The bar drum has 32 bars and the first 27 bars have a movable lug each, the rest of the bars are equipped with stationary lugs which help to move the pinwheels in a complex way (see below about the movement of the pinwheels).
Each of the movable lugs can be set in one of six different positions (corresponding to the six pinwheels). The manufacturer states that the lugs must be placed, so that six intervals arise, which, when added together in all possible ways, can form all numbers between zero and twentyfive. One good arrangement may look like this (the x:s marking positions with lug set):

Example of "good" setting of the lugs.

Position Bar number
**000000000111111111122222222
**123456789012345678901234567
1 xxxxxxxxxxxxx..............
2 .............xxxxxx........
3 ...................xxx.....
4 ......................xxx..
5 .........................x.
6 ..........................x

The six pinwheels interact with the lugs on the bar drum in such a way, that if pinwheel one has got a pin in the active position, the number of lugs in position I on the drum will be added to the displacement key, an active pin on wheel two will add the number of lugs in position II, and so on.
A pinpattern like 100010 will, when using the above lugplacement, give a displacement key of 14 (13+1). The pattern 011111 will also give a displacement of 14 (6+3+3+1+1).

The letter to be encrypted is calculated by the following formula: K - P = C, modulo 26 -- where K is the displacement key-value, P is the number of the cleartext letter (A=1, B=2, C=3, and so on), and C is the resulting cryptoletter. The cleartext letter A encrypted with displacement 14 would become: 14-1 mod 26 = 13, or the letter M. In the machine, this calculation is done by advancing a circular typewheel, which has initially been set to the cleartext letter, the number of steps backwards given by the displacement key-value.
The operator can choose to add a further complication to the encryption algorithm. A constant, S, may be added to the cleartext letter before encryption, making the encryption formula read: K - P + S = C.

After a letter has been encrypted, it is time to step the pinwheels. This is done in an unconservative way, which singles out the CX-52 from other, earlier types of Hagelin machines. The stepping of the pinwheels functions as follows:

  1. Pinwheel one steps one step for each operation.
  2. Pinwheel two steps one step whenever there is an active pin on pinwheel one.
  3. Pinwheel three steps one step whenever there is an active pin on either pinwheels one or two.
  4. Pinwheel four steps one step whenever there is an active pin on either pinwheels one, two or three.
  5. Pinwheel five steps one step whenever there is an active pin on either pinwheels one, two, three or four.
  6. Pinwheel six steps one step whenever there is an active pin on either pinwheels one, two, three, four or five.

The result of this is that, although their progression is irregular, from any initial alignment the six pinwheels will step through every possible offset before coming back to the initial setting. This is a cycle of over 10,000,000,000 steps.


Principles of machine usage.

When using the machine to encrypt a message, the user must first choose to set the constant S, if any. Then the six pinwheels are set to an initial starting position by turning them and setting each wheel against an index. The starting position should vary from message to message.
The pinwheels are labelled around their circumference with 47 symbols, so that it is possible to read off the initial position, which must, in some way, be communicated to the recipient. The following labelling order is used on all six wheels:

A B 03 C 05 D 07 E 09 F G 12 H 14 I 16 J 18 K L 21 M 23 N 25 O 27 P 29 Q R 32 S 34 T 36 U 38 V W 41 X 43 Y 45 Z 47


Download a Qbasic CX-52 simulation program.

If you like, you can download a Qbasic simulation of the CX-52 here:

CX52.ZIP


© Torbjörn Andersson.Torbjörn Andersson Fecit