Kryha - Procedures


Home Page
Kryha Home Page

Introduction

Using an encryption system requires a set of rules known to the various correspondents. These correspondents must primarily share secret elements, first and foremost the encryption keys.

Usually, when using a cipher machine, there are three types of keys:

  • The base key
    This is the machine itself. In the case of version v1, the wheel(s) used are part of the base key.
  • The day key
    In the case of Kryha, this is the two alphabets used and the wheel used (v1) or the wheel configuration (v2). This key is usually in the form of a table printed on paper and is typically valid for one month.
  • The message key
    In the case of Kryha, this is the starting sector and the initial position of the inner (moving) alphabet. This key is different for each dispatch.

Notes:

  • Moving the wheel before or after encryption, as well as using decryption mode instead of encryption mode, can be part of the message key, the daily key, or even the base key if these conventions are consistently followed.
  • I mentioned the daily key. In fact, depending on the number of messages exchanged, the "daily key" can be valid for several days, or even a week.
  • Typical elements of the daily key (the two alphabets, the wheel configuration, or the wheel selection) can be modified together or at different times.
  • Configuring the starting sector does not require opening the machine. A small window above the beginning of the outer alphabet displays the current sector number.

Furthermore, there are other procedural elements that correspondents must share:

  • Should separators be used for words and phrases? Should specific words be used to conceal the names of people or places? More generally, what rules should be followed when preparing the text before encryption?
  • What should be done in case of a breach? Is a special backup key required? Should the machine and the encryption keys be destroyed?

Procedures Used During the Spanish Civil War

Introduction

In 1938, the Nationalist army under General Franco equipped itself with the Kryha v2 cipher machine. A user manual in Spanish was typed and (presumably) distributed to various correspondents.

It seems logical to assume that these procedures are inspired by those provided by the Kryha company.

The manual

Here is the verbatim translation into English of the manual.

		Summary of Instructions for "Kryha" Machines
	              ---------------------------------

   The fixed alphabet corresponds to the actual letters of the plaintext. 
(We will call this Series I).

   The movable alphabet consists of the cipher letters corresponding to 
each letter of the fixed alphabet. (We will call this Series II).

   The internal wheel of numbered screws contains the holes corresponding 
to the internal secret combination. (We will call this Series III).

   Series I, II, and III will undergo periodic changes, communicated to 
the corresponding personnel by the Central Headquarters (Cuartel General 
del Ceneralisimo), indicating the measures to be taken from specific dates.

   Initially, all machines will be delivered synchronized for the first 
phase of work.

   The modifications to Series I and II will determine the order in which 
the letters must be placed, reading on the respective circles counter-
clockwise. The modifications to Series III refer to the numbers that must 
remain holed.

                              ------oooooooo------
				ENCRYPTION METHOD
 
   For each dispatch, the starting point must be given. This is determined 
       by the stopping number of Series III and by the coincidence of a 
       letter from Series II with one from Series I. (Given precisely in 
       this order: first by the letter from the moving wheel and then by 
       the letter from the fixed wheel).

   The starting group, consisting of four letters (two for the cipher of 
the stopping point in Series III, and the initial coincidence letters), is 
given in the dispatch text, inserted in the fourth position of the cryptogram.

                              ------oooooooo------
   This group must be written according to a pre-established cipher, which
consists of:

	1. Look at the stop number, for example, 29 (Series III). If it is 
	   a single digit, simply add a zero before it.

	2. Rotate Series II until the initial letter of the day of the week 
	   being encrypted matches the letter X in the fixed alphabet 
	   (Series I). For example, if it is "Jueves" (Thursday), J is front 
	   of the letter X.

	3. Look at the letters that correspond to the digits two and nine 
	   of Series I in Series II. In our example, these are O and H, 
	   respectively.

	4. Without touching the wheels; that is, we will work in the first 
	   position above. For example, W in M and the corresponding letters 
	   in series II are taken, which are I and Y.
	   The fourth and orientation group will therefore be, as it should 
	   be written in the office:
		OHIY, equivalent to the plaintext group 29 WM

                              ------oooooooo------
   Series II is rotated until the W in M coincidence is found, and the first 
letter of the text is encrypted (in this position), followed by the 
subsequent letters, pressing the movement lever fully for each one.

   In the office, the held letters are grouped in fours, with the last group 
being completed with encrypted Zs.

   When converting letters to numbers, three consecutive Ws are encrypted 
(W.W.W.). For the reverse step, three encrypted Ns (N.N.N.) will be given. 
The value of the number is the one corresponding to the letter in series I.

   Encryption is facilitated by breaking the plaintext into groups of four 
letters and placing the corresponding cipher letter below each group.

   As an extension of the above, we will encrypt the following text using 
the machine's delivery combinations and the starting group used as an example:

		"ENTERADOS INSTRUCCIONES ENTREGAMOS 6530 FRANCOS."

   We will write the plaintext in groups, and below each letter, its 
corresponding cipher letter.

Plaintext  = ENTE     RADO     SINS     TRUC     CION
Ciphertext   MPCE     MPUR     WDKI (") DMUF     JKRS
Plaintext  = ESEN     TREG     AMOS     WWW6     530N
Ciphertext = OXAE     WHJK     BFRQ     OAUC     YXTX
Plaintext  = NNFR     ANCO     SZZZ
Ciphertext = OHMK     LTRA     IAUG

   When writing it in the clean place marked (*), the starting group 
OHIY is placed.

				DECIPHERING.
				------------
With the initial of the day the telegram (Series II) is encrypted placed 
over the X of Series I, the starting group is interpreted and crossed out. 
The marked matches are placed in the same position, and in this position, 
the first letter of the text is deciphered. Then, by lowering the lever 
for each one, the letter from Series II (inner) is replaced in each 
position by the corresponding letter from Series I (outer).

                              ------oooooooo------
	NOTE.

    When submitting dispatches for transmission, and in order to avoid 
errors, the groups must be typed or handwritten using clear, well-spaced 
capital letters.
                              ------oooooooo------
	IMPORTANT NOTE.
	---------------
    Any malfunctioning machine must be taken to Central Office with full 
security guarantees, where it will be repaired or replaced.

				Burgos, December 1938.
				-Third Triumphant Year.-

Comments

Number conversion

We use the numerical values associated with the letters to convert number in letter (see below). We also use number conversion for translation of the startup sector.

to translate the start sector (29), we use the inner alphabet and two letters: O (24) to translate the 2 (there is no letter associated with 2) and H (9) to translate the 9. So we have OH.

Outer alphabet:

	A=18, B=7, C=20, D=12, E=2, F=00, G=/, H=5, I=10, J=15,K=1, L=8,
	M=14, N=&, O=0,  P=17, Q=3, R=-,  S=6, T=16,U=11, V=9, W=0, X=19,
	Y=13, Z=4.

Inner alphabet:

	A=8,  B=20,C=6,  D=28, E=11,F=16, G=27, H=9, I=17, J=7, K=18,L=22,
	M=4,  N=15,O=24, P=14, Q=5, R=13, S=25, T=10,U=19, V=26,W=3, X=12,
	Y=23, Z=21.

Indicating system: the day of the week

To set the starting point of the inner wheel, the day of the week is used (Rotate Series II until the initial letter of the day of the week). Here are the days of the week in Spanish:

	Lunes (Monday), 
	Martes (Tuesday), 
	Miercoles (Wednesday), 
	Jueves (Thursday), 
	Viernes (Friday), 
	Sabado (Sautrday), 
	Domingo (Sunday).

Complements

Fuensenta describes a sealed document, dated February 1941, that contains the new keys and which come from the General State Department.

  • For the fixed (external) alphabet: it is a transposition derived from the CIFRA key (cipher in Spanish).
  • For the movable (internal) alphabet: it is a transposition derived from the KRYHA key.
  • The stop points are 2, 5, 8, 11, 12, 14, 16, 19, 22, 25, 26, 28, 30, 33, 26, 39, 41, 44, 49, 50

Data compression

Introduction

Marks (cf. Reference) informs us that the 1925 manual suggests using Kryha as a system for code over-encryption and data compression.

Indeed, certain letters (D=12, W=23, N=25, etc.) can encode two digits. Therefore, Kryha can encode numbers from 0 to 25. This allows for a form of compression.

Fixed Alphabet: Letters and numeric groups equivalent

	0(O), 1(K), 2(E), 3(Q), 4(Z), 5(H), 6(S), 7(B), 8(L), 9(V),
	10(I), 11(U), 12(D), 13(Y), 14(M), 15(J), 16(T), 17(P), 18(A), 19(X),
	20(C), 21(R), 22(G), 23(W), 24(F), 25(N)

Example

Consider the following code:
	A = 100, B = 101, C=102, D=103, E=104,…, I=109, J=110,K=111,S=119, …, 
	ARM = 124, …, AT = 247, …, CK = 259, …, DAWN = 666, 
	OUR = 221, …, TA = 228, …, WILL = 753

Consider the following clear text: (25 letters)

	Our armies will attack at dawn. 

Here is the coded text: (11 groups, 33 letters)

	221-124-109-104-119-753-247-228-259-247-666

Equivalent text in Kryha (using the fixed alphabet) : (in whole, 22 letters)

	4(Z)-21(R)-12(D)-4(Z)-10(I)-9(V)-10(I)-4(Z)-7(B)-5(H)-3(Q)
	24(F)-7(B)-22(G)-8(L)-25(N)-9(V)-24(F)-7(B)-6(S)-6(S)-6(S)

Note: if there is a group meaning "Attack at dawn", the compression is obvious.

A notable improvement

In 1941, Allied cryptanalysts faced enemy traffic encrypted by the Kryha (from Spain), whose procedures complicated the breaking of the messages.

The most significant of the changes in enciphering procedure is that which introduces the element of key interruption into the system. At the end of each word, the letter J (appearing with "-" dash on a single tab) is enciphered as a word-separator. After each such plain-text J the operating lever is depressed twice instead of the usual once. Thus, the first letter of the next word instead of being enciphered at the setting it normally would, is enciphered at the one following it.

Note: The methods implemented by the allies to solve the traffic are described by Frode Weierud (link).

Reference

Articles & Books

  • Mensajes secretos, la historia de la criptografia espanola desde sus inicios hasta los anos 50, by José Ramon Soler Fuensanta and Francisco Javier Lopez- Brea Espiau, Editor: tirant lo blanch, 2016.
  • Marks, P. 2011. Operational Use and Cryptanalysis of the Kryha Cipher Machine. Cryptologia 35(2): 114-155.

Web sites

  • Frode Weierud (Editor)
    US National Archives in College Park, MD, in Record Groups 38 and 457. A transcript of a handwritten document describing solution of traffic related to German wartime trade with Spain (RG457, Historic Cryptographic Collection, NR2417) (link).