Copyright: Created with EasyHelp/Web +44(0)973 209667


Introduction.

The Siemens and Halske T52d Cipher Machine.

This graphical simulator for the T52d Cipher Machine was designed by Geoff Sullivan and Frode Weierud. A series of models of this cipher machine were developed, designated as Models a/b, c, d and e. The Authors have simulated all of these variants. This simulator is specifically for the T52d Model.

For a detailed description of the construction, operation and cryptanalytic attacks on this machine please refer to the following sources (listed in order of publication):

1. Davies, Donald W.: The Siemens and Halske T52e Cipher Machine. Cryptologia 6(4) October (1982) 289-308

2. Davies, Donald W.: The Early Models of the Siemens and Halske T52 Cipher Machine. Cryptologia 7(3) July (1983) 235-253

3. Davies, Donald W.: New Information on the History of the Siemens and Halske T52 Cipher Machine. Cryptologia 18(2) April (1994) 141-146

4. Ulfving, Lars and Weierud, Frode: The Geheimschriber Secret: Arne Beurling and the Success of Swedish Signals Intelligence. In Coding Theory and Cryptology: From Enigma and Geheimschriber to Quantum Theory. New York: Springer Verlag, Lecture Notes in Computational Science and Engineering (1999)

5. Weierud, Frode: Sturgeon, The Fish BP Never Really Caught. In Coding Theory and Cryptology: From Enigma and Geheimschriber to Quantum Theory. New York: Springer Verlag, Lecture Notes in Computational Science and Engineering (1999)

Item 4 contains a comprehensive Bibliography for the T52.

This helpfile will only describe how this simulator is operated. For details of the cryptographic principle of the T52 please refer to the appropriate literature.

Machine setting.

Each of the ten code wheels have sets of contacts connected to two plugs for each wheel. These plugs must be inserted into a 20 socket patch panel. This forms the main inner key and is usually changed daily. For each message that is to be encoded, the ten code wheels must be set to a different start position, called the message key.

Inner key.

This is an example of the inner key :

A    B    C    D    E    F    G    H    I    K

6-8 1-2   5-7 III  4-10  IV   II   I    3-9   V

The letters A-K represent the ten code wheels. The patch sockets are labeled  1,2,3,4,5,6,7,8,9,10 for the bit permutation circuit and I,I,II,II,III,III,IV,IV,V,V for the modulo-2 addition circuit. The modulo-2 addition circuit requires that both plugs from the wheel connect to both sockets of the pair. For example the two plugs from wheel F connect to the two sockets called IV and the two plugs from wheel A connect to sockets 6 and 8 respectively.

There are two ways to connect the plugs in the simulator. From the Settings menu select the Inner key option to open the dialogue box:

The second way to connect the inner key is graphically by selecting the Plugboard option from the Settings menu. A dialogue representing the 20 plugs will appear:

First select the Clear button to remove all connections. Then select the required plug from this dialogue. Next move the mouse to the main window and click the required patch socket where the plug is to connect. If the patch socket is in the modulo-2 circuit (I - V) then both connections from the code wheel will be automatically assigned. Repeat this process until all plugs are connected. Note that the pair of plugs for each wheel are marked red and black and are interchangeable. They are marked with the suffix r and b in the plugboard dialogue.

Message key

There are two ways to set the wheel positions to the message key.

1. Hold down the Ctrl key on the PC keyboard and click the required wheel with the mouse. The wheel can be made to move forward or back by selecting above or below the centre of the wheel.

2. The message key can also be set up using the Message key option in the Settings menu. Enter the wheel position for each of the ten wheels in the edit boxes:

Enciphering a message

When the machine settings have been made a message can be enciphered from the PC keyboard using these settings. First make sure that the simulator is set to Local in the Options menu and is set to Plain -> Cipher mode in the Settings menu. Also check that the KTF function is off (set to Ohne). Characters typed on the PC keyboard will be entered into the Message In window. The machine will advance as characters are entered. The enciphered text will appear in the Message Out window. To decipher your message first set the wheels back to the Message key (Press Ctrl+R will do this) then set to Cipher -> Plain mode in the Settings menu. Type the cipher text characters that were sent to the Message Out window during enciphering. Plain text should appear in the Message Out window. The logic display in the top right of the main window will show all the steps in the encryption process. The relays show the plain text bit pattern

Menu Options

Here is a short description of all the program menu functions.

File Menu

Open

Reads a text file into the Message In window.

Save Message In

Save Message Out

Writes a text file from the Message window.

Open key

Save key

The Open and Save key allow the Inner settings and Message key to be saved in a named file.

Print Message In

Print Message Out

Prints the Message window contents.

Settings Menu

Plain->Cipher

Cipher->Plain

This sets the machine in the required mode for encryption or decryption.

With KTK

Without KTF

In With KTF mode the third bit of the plain text character is used to control the motion of some of the code wheels.

Auto shift on space

When this option is checked it automatically adds a letter shift character before every space. It is normally switched off (unchecked).

Inner key

Plugboard

These options described earlier allow the inner settings to be selected. This is the arrangement of connections between the wheel plugs and patch panel.

Message key

This allows the Message key or wheel start positions to be specified in a dialogue box.

Comms..

This option sets up the RS232 link. Two PCs connected together via their com ports can be used to simulate the link between two T52 cipher machines. One simulator must be set to transmit (Plain->Cipher mode) and the other to receive (Cipher->Plain mode). When the Comms option is set up in both machines, cipher text received by the receiving machine will be deciphered and displayed; plain text that is enciphered on the transmitting machine will be sent to the comm port output. The link can be specified for 50 baud or 9600 baud. Only COM1 and COM2 are supported (if these are available on the computers) The wiring is as shown below with no handshake. For 9 pin connectors connect pins 5 of both ports together. Pins 2 and 3 should be cross wired. For 25 pin connectors, pin 7 should be used in place of  pin 5.

PC #1	PC #2

 5-----------5

 2-----------3

 3-----------2

A buffer is used on the receiving end so that a PC with slow graphics will not lose characters.

Options Menu

Clear Message In

Clear Message Out

Deletes the text in the Message windows.

Reset Wheels

Moves the code wheels to the start positions. The start position is remembered each time the wheel positions are adjusted.

Zero Wheels

Sets all code wheels to position 01

Encipher text

This enciphers the text in the Message In window and sends the output to the Message Out window. The current machine settings are used for this process.

Characters are entered into the Message In window in Local mode. When Local mode is off then clicking over the Message In window with the mouse will bring up a text cursor and characters can be entered off-line without enciphering. The Message In window can also receive text from the Open function in the File menu.

Letters

Figures

These two options set the character set to Letters or Figures mode. If used when enciphering then these control codes will also be enciphered and appear in the cipher text. This option is not normally required as the simulator will detect when character shifts are required and insert them into the text stream. Note that an enciphered control code will be deciphered at the receiving end and interpreted as a control character to control the receiver's teleprinter.

Tools Menu

Print Map

This prints the machine logic states for the first five enciphered characters from the Message In window. The encipherement will commence with the currently displayed wheel positions.

Button Functions

The buttons at the foot of the main screen repeat some of the menu functions as follows:

With KTF / Without KTF

switches the KTF function on or off.

Letters / Figures

Sets the Letters or Figures mode (this is not normally required since Figures /Letters shift is automatically applied)

Plain->Cipher

Cipher->Plain

Selects the encipher direction. This is required for 2 reasons. (a) the cipher is an additive key followed by a transposition key. To decipher, these operations must be carried out in reverse order. (b) If the KTF function is operational, then the third bit of the plain text is obtained from the input stream in Plain->Cipher mode and in Cipher->Plain mode this bit is obtained from the output stream .

Local / Line

Local mode allows direct encipherment of keyboard input. Line mode (Local off) is used to encipher text in the Message In window, using the Encipher text menu option.

Home

Resets the code wheels to the starting or home position.

Clear Input

Clear Output

Delete the text in the Message windows.

Zero

Sets all the code wheels to position 01.


KTF switch

To the left of the keyboard is the KTF (Klartextfunktion) function switch.

When this switch is in the 'mit'  position, the stopping magnet logic uses the third bit of the plain text  to control the movement of some of the code wheels.

The switch can be operated by holding down the PC Ctrl key and selecting the switch with the mouse.  The switch is also repeated in the Settings menu.


Logic Window

This display shows the results of the additive key and the transposition of each bit.

A code is used to indicate some non-printable plain text characters:

LT	Letters

FG	Figures

SP	Space

CR	Return

LF	Line feed

The 32 possible cipher text patterns  are represented (following BP conventions) by the characters A-Z for the printable Baudot codes and 3,4,8,9,= and / for the control characters, in both the Logic window and the Message window. This is the data that is normally passed through the communications line or radio link.


Relays R1 - R5

These relays hold the state of the 5 bits of the plain text of the last transmitted character. The Z relay is a repeat of bit 3 inverted and is the bit used in the KTF function logic.


Code Wheels

The 10 code wheels designated by the letters K J H G F E D C B A are displayed in the main program window. Each wheel has a different cam profile. The cam profiles are represented by grey and black segments, the black representing the cam valleys, and the grey the cam hills.

The numbers on each wheel indicates the wheel positions. The wheel periods  are from left to right 47, 53, 59, 61, 64, 65, 67, 69, 71 and 73.

Wheel starting positions can be set by holding down the PC keyboard Ctrl key and clicking with the left mouse button on the 'thumbwheel' of the wheels. The wheels move forward or reverse depending on whether the thumbwheel is selected below or above the wheel axis.

Each wheel operates two sets of contacts, A and B:

A Contacts

The upper row of black/red pointers represent the A contacts. Black indicates the contact is positioned on a valley and is unoperated. The A contacts operate the wheel stopping magnets, according to a particular combination table for each magnet (for example wheel E is stopped when contact F is on a cam valley and contact G is on a cam hill).

Each wheel moves one step during a transmission cycle unless held by its stopping magnet

The black/red square markers below each wheel shows the states of the stopping magnets. Red indicates the magnet is energised and the wheel will not advance in the next cycle.

B Contacts

The lower set of black/red pointers represent the B contacts. These operate the 5 bit additive key circuit and the 5 bit transposition circuit.

A and B contacts are separated on the cam circumference by about 1/3 revolution.