दुर्गा बेरागी Durga Beragi, homeEnter the study →

Library › Cryptography, blockchain and crypto › Elementary Cryptanalysis › Full text

Elementary Cryptanalysis

Helen Fouché Gaines · part 10 of 18 · 146,045 words

Public-domain edition · source: Project Gutenberg eBook #75074 · Public domain in the USA (Project Gutenberg)

Ab A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Cd A B C D E F G H I J K L M O P Q R S T U V W X Y Z N

Ef A B C D E F G H I J K L M P Q R S T U V W X Y Z N O

Gh A B C D E F G H I J K L M Q R S T U V W X Y Z N O P

Ij A B C D E F G H I J K L M R S T U V W X Y Z N O P Q

Kl A B C D E F G H I J K L M S T U V W X Y Z N O P Q R

Mn A B C D E F G H I J K L M T U V W X Y Z N O P Q R S

Op A B C D E F G H I J K L M U V W X Y Z N O P Q R S T

Qr A B C D E F G H I J K L M V W X Y Z N O P Q R S T U

St A B C D E F G H I J K L M W X Y Z N O P Q R S T U V

Uv A B C D E F G H I J K L M X Y Z N O P Q R S T U V W

Wx A B C D E F G H I J K L M Y Z N O P Q R S T U V W X

Yz A B C D E F G H I J K L M Z N O P Q R S T U V W X Y

The Porta tableau, being smaller than the Vigenère, is not at all inconvenient to prepare and use as it stands. It can be made still more compact: The upper half being alike for all thirteen cipher alphabets, this half can be written once only, at the top of the chart. The lower halves can be written below this on thirteen parallel lines, with their pairs of keys at the left. A ruler may then be used, as suggested for Vigenère, to point out any given lower half. But when it is noticed that these lower halves are identically the same series of letters, with its point of beginning shifted one letter at a time, it is promptly seen that a slide is possible, on which the N-to-Z half of the normal alphabet, if written twice in succession, could be placed in 13 different positions with reference to the A-to-M half; and a slide is more convenient still. The slide shown in Fig. 96 is another of Ohaver’s devices. The only new feature in connection with the Porta slide lies in the handling of the key-letters, which, in this cipher, are no longer the first letters of their cipher alphabets. Mr. Ohaver has added them on the sliding portion of the device, each pair of keys being placed directly below the letter which must stand beneath the index (A) whenever one or the other of the pair is the key-letter in use.

Figure 95

Porta Encipherment

Keyword: E A S T E A S T Plaintext: S E N D S U P P... Cipher: D R E Z D H G G...

(Compare:)

Keyword: F A T S F A T S Plaintext: S E N D S U P P... Cipher: D R E Z D H G G...

The Porta cipher, aside from its purely historical interest, provides a most interesting decryptment study in the formation of its alphabets. Notice that because of the encipherment scheme itself, it becomes totally impossible that the substitute for any letter, in any cipher alphabet, can ever be taken from its own half of the normal alphabet. This limitation is far more visible than that of the Gronsfeld. We have, say, a cryptogram sequence H E P. Can this represent the trigram THE? No, because E cannot represent H; for the same reason, it cannot represent THA. Can it represent AND? No, because H cannot represent A. Can it represent ENT? No, because H cannot represent E. Can it represent ION? TIO? FOR? NDE? HAS? It is not until we reach STH that we find a normally frequent trigram which could have the substitutes HEP. But to gather the full significance of this Porta limitation, and also a suggestion concerning the detail work when taking advantage of it, let us picture the case of a probable word: INFANTRY.

Figure 96

A Slide for PORTA - Devised by OHAVER

┌─────────────────────────────────┐ │ A B C D E F G H I J K L M │ ┌───────────┤ ┌───────────────────────────┐ ├───────────┐ │ N O P Q │ │ T U V W X Y Z N O P Q R S │ │ V W X Y │ │ │ │ │ │ │ │ │ │ (Keys) │ │ │ │ A C E G │ │ M O Q S U W Y │ │ │ │ B D F H │ │ N P R T V X Z │ │ │ └───────────┤ └───────────────────────────┘ ├───────────┘ │ │ └─────────────────────────────────┘

Using digits 1 and 2 to mean, respectively, the first and the second half of the normal alphabet, this probable word INFANTRY has the alphabetical pattern 1 2 1 1 2 2 2 2. And, since every substitute must have been taken from the other half of the normal alphabet, it will certainly be represented in any Porta cryptogram by eight letters having the opposite alphabetical pattern: 2 1 2 2 1 1 1 1. Moreover, a pattern as long as this is not going to be found very often in any one cryptogram. The decryptor, then, may proceed as in Fig. 97. Each cryptogram letter is marked I or 2, or imagined to be so marked, and this series of digits is examined in the hope of finding a sequence 2 1 2 2 1 1 1 1. If it cannot be found, the word is not present; if it is found, it can be assumed to represent the word INFANTRY. Here, we meet with a slight difference between the procedure for Vigenère and the procedure for Porta.

Figure 97

The Probable Word Method in Porta

Pattern of word INFANTRY: 1 2 1 1 2 2 2 2 Pattern of substitute: 2 1 2 2 1 1 1 1

The cryptogram, with pattern:

F J I D T U V S S L F F I T X M S T M E D L 1 1 1 1 2 2 2 2 2 1 1 1 1 2 2 1 2 2 1 1 1 1

Determining the KEYWORD:

.....X M S T M E D L..... I N F A N T R Y

E C A M C E C A F D B N D F D B D A N C E

In Vigenère, we found it possible to discover the key by simply taking the probable word and deciphering with it. In Porta, we cannot do this. We must first pair the two letters, that is, a supposed substitute with its supposed original, and then find out what key would cause this. In the figure, for instance, we have a sequence X M S T, assumed to represent I N F A. The first corresponding pair is X = I. If we are using the tableau of Fig. 94, one of these letters, I, is never found anywhere except in the 9th column. We find the I-column, and trace down until we find X; the key, in this case, must be E or F, The next corresponding pair of letters (M representing N) demands that we find the M-column and trace down to N; key C or D. The third pair (S representing F) demands that we find the F-column, and trace down to S; key A or B. The fourth pair (T representing A) demands that we find the A-column, and trace down to T; key M or N.

Using the slide of Fig. 96: Place X and I together, and note that the key-letters standing below the index (stationary A) are EF. Place M and N together, and note key-letters CD. Place S and F together, and note key-letters AB. Place T and A together, and note key-letters MN. From the recovered pairs of key-letters, we are to select one each in order to recover the key-word, using somewhat the logic we might apply in dealing with a key-phrase cryptogram. In the given case, where we need the two vowels to form any word at all, it is not difficult to surmise that the key-word was DANCE. It might not be so easy to decide as between EAST and FATS; but key-words, as a rule, are seldom so short as those we have been using, and the longer the word, the fewer the possibilities. Concerning keys, however, there is one contingency which may have to be considered: The various modernized versions of this tableau are not always duplicates. The cipher alphabets will be the same as those given here; but where we have caused these to shift in the normal direction, another tableau may show them shifting in reverse. The first alphabet will be the same as here, but the second, still showing key-letters CD, will show its lower half beginning Z N O P. . . ; the third, still showing key-letters EF, will show its lower half beginning Y Z N O P. . . ; and so on. The recovery of the key-word, of course, is not vital.

* * *

Coming now to the two ciphers which are called Beaufort, we return to a tableau so closely resembling Vigenère’s tableau that the two can be used interchangeably. Fig. 98 shows only enough of the Beaufort tableau to bring out the difference in form. Here, we find no separate plaintext alphabet and no separate key-alphabet. Those which form the square have been lengthened by repeating their first letters; and a 27th alphabet, added at the bottom of the tableau, repeats the alphabet shown at the top. In this way, we have a 27 x 27 alphabet square in which all four of the outside alphabets are exactly alike. These ciphers, also, make use of a key-word, applied as in Vigenère and in Porta. As Sir Francis Beaufort himself is said to have used the tableau, the encipherment of a given plaintext-letter, using a given key-letter, was accomplished as follows: To encipher plaintext S with key C, find the letter S in any one of the four outside alphabets, trace into the square along the S-column (or row) as far as the key-letter C; at that point, turn a right angle, in either direction, and trace outward along that row (or column), emerging from the square at the substitute, which, in the given case, is K. Or: To decipher K with key C, begin with K, and follow identically the encipherment process, emerging this time at the plaintext letter, S. This process we have called the true Beaufort cipher. Notice that we have reciprocal encipherment; encipherment and decipherment are identically the same thing.

Figure 98

Upper Portion of the BEAUFORT Tableau

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F G H I J K L M.... (Etc.) ....W X Y Z A B C D E

There are no external alphabets. The four outer alphabets of the square are exactly alike, with A in each of the four corners.

TRUE BEAUFORT Encipherment VARIANT BEAUFORT Encipherment

Key: C O M E T C O M E T C O Key: C O M E T C O M E T C O Plaintext: S E N D S U P P L I E S Plaintext: S E N D S U P P L I E S Cipher: K K Z B B I Z X T L Y W Cipher: Q Q B Z Z S B D H P C E

As to the companion cipher, the student will promptly have guessed this for himself: Instead of starting with the plaintext-letter, S, and tracing inward to the key-letter, it is entirely feasible to begin with key-letter C and trace inward to the plaintext-letter S, emerging at Q instead of at K. This cipher, too, is called Beaufort, since its method of accomplishment is Beaufort’s method. But there is a difference in the two resulting ciphers; notice here that the encipherment is no longer reciprocal; should we start at key-letter C, trace inward to the new cipher-letter, Q, and then trace outward, we do not emerge from the square at the plaintext letter S, but at O, an entirely new letter. In order to distinguish the two ciphers, we have referred to this second process as the variant Beaufort, or sometimes, more briefly, as “the variant.” There is some justification, also, for calling it the “Vigenère-Beaufort.” To see why, the student may turn back to his Vigenère tableau, and actually perform the encipherment, using only the two sides of this tableau in which the alphabets run from A to Z.

In applying the variant encipherment, in which key-letters are found first, he need find a given key-letter but once, then lay a ruler along the row (or column) indicated by that key-letter, and encipher at a single writing all plaintext letters which are going to have that particular key. But if, as previously recommended, he has familiarized himself with the use of the Vigenère tableau, he will see instantly that the operation which, in the variant Beaufort he is calling encipherment, is identical, in every particular, with the operation which, in Vigenère, he would have called decipherment, and that, in order to decipher the variant, he must perform the operation which, in Vigenère, is called encipherment. Neither of these operations provides a reciprocal substitution; instead, they are reciprocal to each other. Once it is seen that this is true, it becomes equally plain that the Saint-Cyr slide serves just as well for the variant as for the Vigenère. To make use of it in applying the variant encipherment, set key-letters below index-letter A, exactly as if making ready to encipher in Vigenère, but reverse the functions of the two alphabets; that is, find all plaintext letters in the lower one, and take their substitutes from the upper one.

Figure 99

How to find the C-alphabet of each Beaufort

True Beaufort Variant Beaufort

Key: C C C C C C C C Key: C C C C C C C C Plaintext: A B C D E F G H... Plaintext: A B C D E F G H... Cipher ALPHABET: C B A Z Y X W V... Cipher ALPHABET: Y Z A B C D E F...

Now, consider the true Beaufort cipher: Here, plaintext letters are found first, and keys are found by tracing into the square, so that encipherment is more or less a letter-by-letter process, and hardly so convenient as in the other two ciphers. It is true that every ascending diagonal in the tableau is made up of only one key-letter, so that a ruler, laid diagonally across this tableau, will point out a whole line of C’s, or O’s, or M’s. But practically every one of these diagonals is broken into two portions, so that in attempting to encipher by one key-letter at a time, we find it rather confusing to make the necessary adjustments. Is there not, then, a more convenient method for applying the Beaufort? Every cipher of this family, remember, provides a certain number of individual simple substitution cipher-alphabets. For every key (whether it is a letter or a number) there is some kind of cipher alphabet showing a substitute for A, a substitute for B, a substitute for C, and so on. To isolate one of these cipher alphabets, and find out what it is like, we have merely to take some one key-letter (or some one key-number) and discover what these substitutes are, and what their order is; that is, we need merely encipher the normal alphabet, using this one key. This is true of every cipher of the multiple-alphabet type. The process can be seen in Fig. 99, where the C-alphabet (that is, the alphabet governed by key-letter C) is being isolated for each of the Beaufort ciphers.

In the Beaufort proper, we find that the C-alphabet will begin with C and come out in the order C B A Z Y X. . . . , which is merely the normal alphabet reversed. Should we investigate the D-alphabet, we should find that this begins at D and comes out in the order D C B A Z Y. . . . , again the normal alphabet reversed; or, investigating the E-alphabet, we should find E D C B A Z. . . . , always the normal alphabet written backward, and always beginning with whatever letter is called the key. This being the case, it becomes quite evident that a slide is possible, and the formation of this slide is clearly indicated in the left-hand tabulation of the figure: Its upper alphabet must run in one direction and its lower alphabet in the other; if one of the two is made of double length, it becomes possible to place any one of the 26 key-letters in juxtaposition with index A, thus bringing into position any one of the 26 cipher-alphabets which are governed by these keys. Nor does it make a particle of difference which of the two A’s, the upper or the lower, is regarded as the index-letter; when C is standing below A, then A is also standing below C. We saw, in the tableau itself, that the true Beaufort encipherment gives reciprocal substitution. This, however, was not our first meeting with one of the Beaufort alphabets; in Chapter IX, we met the Z-alphabet. We saw there that whenever a cipher alphabet is merely the plaintext alphabet written backward, it makes no difference which of the two is called a cipher alphabet; we may see here that this fact is not altered by shifting one of the alphabets. Since a slide is possible, it follows that a disk is also possible. This particular cipher disk, on which one alphabet runs forward and the other backward, was used long ago in our own army, and is widely known in this country as “The United States Army Cipher Disk.” Most persons, apparently, prefer the slides, on which the letters are always right-side up, and the preparation of which does not involve the division of a circle into 26 equal arcs. Of those who prefer the disks, practically all will make the smaller disk reversible, with the normal alphabet on one side and the reversed alphabet on the other.

Figure 100

A Pair of COMPLEMENTARY Alphabets:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A Z Y X W V U T S R Q P O N M L K J I H G F E D C B

By doubling the length of one or the other of these two alphabets, we may use them to form a slide which will encipher and decipher the true BEAUFORT.

Now, returning to our Fig. 99, and examining its right-hand tabulation: We find that, in isolating the C-alphabet of the variant Beaufort, we have merely reproduced the Y-alphabet of the Vigenère. Should we now isolate its Y-alphabet, we should find that we have obtained the C-alphabet of the Vigenère. Further investigation will show that the D-alphabet of one is the X-alphabet of the other, that the E-alphabet of one is the W-alphabet of the other; and so on. Only their A-alphabets and their N-alphabets are keyed alike. Thus we seem to have here a case of “reciprocal” key-letters. These particular pairs of corresponding letters, B and Z, C and Y, D and X, and so on, are called complements, one letter of each pair being complementary to the other. Since the letters A and N have no complements (or serve as their own complements), the normal alphabet will furnish only twelve such pairs, and these are shown complete in Fig. 100. In this same set-up, it can be seen that the A-alphabet of the Beaufort cipher is the complement of the normal alphabet. Thus, having provided ourselves with a Beaufort slide (or disk), we have always at hand a means for finding out the complements of letters. Once it is clearly understood that the chief difference between a Vigenère cryptogram and a variant cryptogram lies in the names of their respective cipher alphabets, it becomes evident that we might decrypt a variant, believing it to be a Vigenère, and have no trouble whatever in reading its message, though finding that it has an incoherent key. Vigenère keys, of course, can be incoherent; occasionally they are based in some way on numbers, following the Gronsfeld scheme. But usually, this is not true; the incoherency is only apparent, and a little investigation will discover what the trouble is. In the case just mentioned, the variant key-word COMET will come out in Vigenére as Y M O W H, or vice versa; all that is necessary, in order to discover the original key-word, is to set the Beaufort slide at the A-alphabet, and perform a bit of simple substitution. Another cause for the apparently incoherent key lies in the use of some other index-letter than the stationary A. Say, for instance, that the encipherer has used the key-word COMET, but has placed his key-letters beneath index D. The key recovered by the decryptor is Z L J B Q; to find the original key-word, he need merely “run it down the alphabet.”

Figure 101

Applying a PROBABLE WORD to BEAUFORT (a) Cryptogram, TRUE BEAUFORT: K K Z B B I Z X T L Y W T Q

Probable word.......... S C C R T T A R P L D Q O L I U E T V V C T R N F S Q N K P O Q Q X O M I A N L I F P Q . . . M I A N . I . L E I T E C S O

Use the word SUPPLIES as a trial key, exactly as in Vigenère, but make use of the VARIANT method, and not tho TRUE BEAUFORT.

*** *** (b) Cryptogram, VARIANT BEAUFORT: Q Q B Z Z S B D H P C E H K

Probable word............. S Y Y J H H A J L P X K M P S U W H F F Y H J N V I K N Q P M K K D M O S A N P S V P . . . . O S . N . P . L W I H E Y S M

This was deciphered as a Vigenère, and showed the repeating of a scrambled key: Y M O W H. Had it been deciphered with the BEAUFORT SLIDE, suggested in Figure 100, it would have reproduced the plaintext keyword, C O M E T.

Of the ciphers we have seen, then, those three which are complete, that is, which employ a full 26 alphabets, are curiously interrelated to one another. In the matter of substitution (encipherment and decipherment), the Beaufort stands alone, in that it is reciprocal, while the other two ciphers are reciprocal to each other in this respect. But in the matter of keys, it is the Vigenère which stands alone, in that it can be deciphered indifferently by key-letter or message-letter, where this is not true of either Beaufort. In this respect, these two ciphers are reciprocal. To see this plainly, we may examine our three encipherments, each one showing a different cryptogram obtained from the plaintext fragment SEND SUPPLIES, using key COMET. The Vigenère version was seen in Fig. 90. If this be deciphered with its message, SEND SUPPLIES, the result is a repeating key-word COMET COMET CO. The other two cryptograms were those of Fig. 98. Here, the Beaufort cryptogram, beginning K K Z B B, if deciphered with the key COMET, gives the message-letters S E N D S. But when we attempt to decipher it using S E N D S as our key, we obtain: I U O C R. It becomes necessary, in order to find out our key-letters, that we proceed as we did for Porta: Assuming that the slide is being used, place message S beside cipher K, and find out what key-letter is standing beside the index A. Place E and K together, and find the next key, and so on. That is, change the position of the slide for every decipherment.

In this same figure, the variant cryptogram begins Q Q B Z Z. If it be deciphered with the correct key-word COMET, we obtain the correct message-letters, S E N D S. But if we attempt to decipher it with a key S E N D S, we obtain the same series as in the other case: I U O C R. To decipher it as a variant, we must again proceed letter by letter. How, then, are we going to apply a probable word as we did with the Vigenère in Fig. 90? How are we going to decipher a whole row of letters, first as S, then as U, then as P, and so on? Must we do this letter by letter, shifting the slide for every letter on every row? And suppose it is a page of trigrams, where we wish to decipher every trigram on the page as THE? Is there no way in which we can decipher all first-letters as T, all second letters as H, and all third letters as E, with only three settings of a slide? The answer is simple. Switch the slides. We have said (and shown) that in this respect the two Beauforts are reciprocal. Where the cryptogram is true Beaufort, and you desire to use your probable word as a trial key, do this with your Saint-Cyr slide (used in reverse, that is, as if enciphering in Vigenère). If your cryptogram is variant Beaufort, use the Beaufort slide (or treat it as a Vigenère, and obtain the key later). Both cases can be looked at in Fig. 101. The cryptogram at (a) is our same Beaufort cryptogram; that at (b) is our same variant. In another chapter, we shall look a little more closely into this odd triangle of Vigenère-variant-Beaufort. Meanwhile, the interested student might like to investigate for himself a few of the curious angles:

Would it be possible to prepare a tableau for the true Beaufort, and use it in exactly the manner described for Vigenère? Recalling the appearance of the Vigenère tableau (Fig. 85): Suppose we should add to this another vertical alphabet, this time on the right-hand side, causing this new alphabet to begin at A and run backward, A Z Y X. . . . Could this new alphabet be made to serve any useful purpose? More than one? What about the reversible cipher-disk? Is there any way at all in which it would be possible to encipher and decipher Vigenère cryptograms with a Beaufort slide, or Beaufort cryptograms with a Vigenère slide? Could you make a cipher disk for the Porta?

110. By NEON. (Gronsfeld).

J Q Q Y P I R S F Q Y J N E U R U V E F V W P E B Q F G T E M K U K G R W E T Z I D V I Q Q S Z I H K W M C E K B F J Q Q X T R F V R J K O A T E E N J U M S N G L P I B S O A S R Y S A X R U O J G W M V R U S V D Q Q R D P P K P L I C.

111. By B. NATURAL. (Gronsfeld).

L N P L G S Y R U A I R I Q X R E N D I U U N H D Y M S U U O Q N S T I T U G L W R E R V B Z D U Q S I C T U Q B T F X J F E H J W N I K U N H A Y H I E P R G X K W M P U K U L F N G Q P R B X Z R E T E U U W T R X J F N H J Y O J U V S P N W O Z G S O Q C J N W K G E B X Z R I P U N X B N A W O -

112. By B. NATURAL. (Porta).

I O U K J G F Y S M Q S X H W W D P K M M J E S P Y W Y L B X B V U D X T V L V O G Q K S L W W Q S E U D K W J I A M G W Z C W F O U I M M V Z F U Q K S O X D S E L E E P T I O T U L U L W W P K Q K S Z E U.

113. By KRIS KROST. (Beaufort. Probable word: AMERICA).

N D L H T I E Y R K F M F H L C S Z Q A H B H T Y H A F P I V I D C S X P Z E X N K W Q R M S A H E Q X G R E H A U H G D S O O A G X U G D W G T I L S A P D V H A Q W E W Z M I M Y Y Q O B F E K C M M T F N E V H W Z Y B G P W V E H R Z V U O O N B K X F O Z J A Z I Q N Z T T O P R V I T.

114. By WHOSIT. (Variant Beaufort).

K O A S Y B B S G P A R Y A T F R F D U L W H J A R G H S G U W D B C J R V M C U P S T Q W M B Y S I W Y I F H B A A F I A N Y H J L S B T J O C Z E E N N R U A S R U I E J N O E P S G C G W V U M E A K W R L Y H N S R G H B A H.

115. By PICCOLA. (Short Simple Substitution. - No keyword).

O F T D A F F B E H Z H W G W F O M; M F W R J D E D N V F P Z K W F D Y F M Z Q K K Z T.

CHAPTER XIV The Kasiski Method for Periodic Ciphers

Prior to the 1860’s, the ciphers of the past two chapters had been regarded as entirely safe. A radical change of opinion took place in 1863, when Major F. W. Kasiski, a German cryptanalyst, was so indiscreet as to publish certain of his observations. The student will surely have noticed, among the examples of Chapters XII and XIII, the happening which is suggested in Fig. 102. Some sequence, usually a digram, is repeated in the plaintext, and happens to be enciphered more than once by exactly the same few key-letters; the result is a repeated sequence in the cryptogram. What he may have failed to notice is the periodicity of such repeated sequences. In order that the same few key-letters be used again, the key-word must have been repeated an exact number of times, so that, in these cases of repeated cryptogram-sequences, the distance from first-letter to first-letter is evenly divisible by the key-length — or period (in the figure, the distance from V to V is 10, which is twice the key-length, 5). This does not mean that all repeated sequences found in Vigenère cryptograms are periodic. Often, they are purely accidental; oftener still, they will be due to the repetition of alphabets in the key itself, especialiy if it is such a word as CORCORAN or DESDEMONA. But a distinct majority of them, according to Kasiski, are caused by periodicity; and if all of the repeated sequences found in a given cryptogram be examined to find what the separating interval is in each case, and if all of these intervals be factored, the factor which predominates will betray the period of the cryptogram.

Figure 102

A common happening in all PERIODIC ciphers:

Vigenère key: C O M E T C O M E T C O M E T C O M Plaintext: T H E R E I S A N O T H E R Q U E S REPEATED SEQUENCE: V V Q V . . . . . . V V Q V . . . .

In order to have a look at the Kasiski method, we will consider the cryptogram shown in Fig. 103; and, to approximate a more troublesome case, we will assume that no repeated sequences can be found except those few which have been underscored in the figure. With the cryptogram-letters serially numbered, in the manner shown, the distance apart of any two of them is readily learned by subtraction. The digram CH is found beginning at the 1st letter and again at the 46th letter; 46 minus 1 equals 45, their distance apart. Thus, if CH is one of the periodic repetitions, the period could be 15, 9, 5, or even 3. The trigram UBF, 8th and 63d letters, shows an interval 55; here, the period could be 11 or 5. Notice that a period 5 has been indicated by both.

Now let us look at Fig. 104, where the method of presentation is once more a debt to M. E. Ohaver. In this figure, the repeated sequences have been listed, and each one is accompanied by the two serial numbers of its two first letters, together with the interval which was obtained by subtraction. Ohaver’s process provides a column for each possible factor, beginning with 2 and carried as far as desired. Opposite each interval, its various possible factors may then be noted in their correct columns. In the average case, the correct period will be pointed out by the column showing the largest number of entries. But in this connection, it must be taken into consideration that small factors 2 and 3, and even factors 4 and 5, are usually present in considerable numbers, partly as accidentals, but also because they are factors of the period itself; that is, if the period is 6, there will surely be factors 2 and 3 for every factor 6, and there will usually be a few extra appearances due to accidental repetition.

Figure 103

5 10 15 20 25 30 C H G S L F A U B F X U P H S J D A G Y X M N Z U W W J P D

35 40 45 50 55 60 J S U P L G C G F K R N I M F C H K O A Q A V X O N N U I L

65 70 75 80 85 90 N S U B F N D V P K A I P L S N M Q O H M E U I L B L K Q W

95 100 105 110 115 120 N D V I Y X U I I A Q E U U Y J W C O K O E N M P W W J J J

125 130 135 140 145 150 Q I U O V C M W D O X F C O L F S K U L V B W U N R V G T B

155 160 165 170 B S Q N L U E P H A Q T Q X V A K Q O E

Now, considering our tabulation, and ignoring the fact that short periods like 2 and 3 are seldom encountered, we find that factors 3 and 5 are present in equal numbers. Often, we are faced with exactly this problem. Here are two factors which have appeared in approximately equal numbers. Which one of these actually represents the period? Ohaver’s recommendations include these: Where two factors seem almost equally prominent, select the larger if it is a multiple of the smaller. If one factor is not a multiple of the other, try to select a period which is a multiple of both (as 15 here, includes both 3 and 5). He points out also that the factor which is the correct key-length will usually be accompanied, in the tabulation, by quite a number of its own multiples, growing gradually fewer and fewer as their size increases. In this respect, our factors 3 and 5 are both disappointing. If we consider factor 5, we find factors 10 and 15, but not growing fewer; instead the number increases. We find no factor 20, but we do find a factor 25; another increase. Or, if we consider factor 3, we find factors 6 and 9, but no factor 12, and then a sudden increase in the number of factors 15. This is a case in which the decryptor would play safe by selecting the period 15.

Figure 104

Tabulation for Finding Period M.E.OHAVER

Repeated Positions - POSSIBLE FACTORS of INTERVALS Sequence Intervals

C H 46 - 1 = 45 3 5 9 15 U B F 63 - 8 = 55 5 11 U P 33 - 12 = 21 3 7 21 S U 62 - 32 = 30 2 3 5 6 10 15 P L 73 - 34 = 39 3 13 W W J 116 - 26 = 90 2 3 5 6 9 10 15 18 N D V 91 - 66 = 25 5 25

The factors found in the largest number of DIFFERENT intervals are 3 and 5.

The student who cares to examine this matter more closely may do so by preparing for himself a less haphazard listing of the cryptogram’s repeated sequences. Perhaps the most satisfactory way of doing this is to begin by making a general frequency count. Then, in order to have the more reliable information at once, start the tabulations by examining those letters whose frequency is only 2; follow this with an examination of those having a frequency of 3, and so on. The theory is that letters of these frequencies are much more likely to belong to only one alphabet, while the letters of higher frequency have probably been enciphered in several different alphabets, so that their repeated sequences are not so sure to be periodic. For other cases in which there may be some doubt, the writer’s advice is to select large factors in preference to small factors. Or, if the decision must be made between two factors such as 6 and 7, where a period of 42 would be necessary in order to include both, simply select the handiest and give it a trial. With the longer cryptograms, as we shall see in a moment, an error in the choice is very speedily discovered; as to the shorter cryptograms, there is one rule which invariably holds good: If you meet with any resistance at all in dealing with the kind of ciphers which were shown in the past two chapters, you have probably selected the wrong period.

Figure 105

Individual Frequency Counts - PERIOD 5

Alphabet 1 Alphabet 2 Alphabet 3 Alphabet 4 Alphabet 5

A 11 11 1 111 B 11 1 11 1 C 111 1 11 D 111 1 1 E 1111 1 F 11 1 1 111 G 1 111 1 H 11 11 1 I 11 11 1111 J 111 11 1 1 K 1 111 111 L 1 1 11111 11 M 1 111 11 N 11111 11 11 1 1 O 1 11111 1 11 P 111 111 1 Q 1111 1111 1 R 11 S 1111 1 11 T 1 1 U 1 11 11111 11 111 1 V 1 1 111 11 W 11 111 11 1 X 1111 11 Y 111 Z 1

Often, however, where one clue is missing, there will be another present to take its place. Repeated trigrams are less likely than repeated digrams to be accidental, and longer repeated sequences are still less likely to be so. In the present tabulation, we find that three of the repetitions are trigrams; in all three cases the period 5 is suggested, while only one suggests also a period 3. That is, if we use a period of 15, two of these trigrams will have to be considered accidental.

If the period here is 5, then we are dealing with five simple substitution alphabets. These five alphabets have been used over and over again, always in a given rotation; therefore, if the cryptogram be rewritten into five columns (it is already conveniently grouped), the letters in each column will belong to one same alphabet, and it becomes possible to take a separate frequency count on each one of these five alphabets. These individual frequency counts may be seen in Fig. 105. Originally, we had a length of 170 letters, and, if the student desires to take a frequency count on the complete cryptogram, he will find that he has no truly predominant letters which could represent some of the letters E T A O N I R S H. Instead, he has a series of frequencies which are all fairly close to 4% of the text (6 or 7), and which, should he rearrange them in decreasing order, would have somewhat the following appearance: 10-10-10-9-9-9-8-8-8-7-7-7-7. . . . . .3-2-2-1. He will probably find, also, that every letter of the alphabet has been used at least once, something which would be very rare indeed in any normal English text of 170 letters. But in these five individual frequency counts, each belonging to a separate alphabet, matters are different. Here, the alphabets represented have a length of only 34 letters each, and yet, in the third, fourth, and fifth alphabets, there is one predominant letter, which could represent E, or some other letter which has taken the place of E, while, in the first and second alphabets, there are some few letters distinctly more prominent than others. Also, each alphabet has shown some gaps in sequence, where letters of the class J K Q X Z, and possibly also some letters like B P V W, would surely be missing in a normal text of only 34 letters.

A frequency count made on columns is not, of course, normal. We saw this in dealing with transpositions, when we considered vowel-distribution. Yet, as length increases, we find that the letters present in columns begin to approach more and more the proportions found in normal text; here, with only 34 letters, it would be possible, in any one of these frequency counts, to assign the letters to groups of high, moderate, and low frequencies. Whenever our frequency counts do not have this general aspect, the period cannot be correct. (There are, of course, the very short cryptograms, in which the actual frequencies are not apparent.) So far, we are dealing with any cipher whatever of the periodic type, and many of these ciphers do not make use of simple shifted alphabets, or even of alphabets which are in any way related to one another.

Now let us consider the one case in which the alphabets are all “Caesars.” In this case, whether the cipher is Vigenère, Beaufort, or Porta, we have only to identify one letter in order to identify a whole alphabet. Suppose we examine, first, alphabet 5, in which the one outstanding letter, L, has appeared 7 times. Does this letter represent e? If L of alphabet 5 represents e, then, counting backward (that is, upward), we find that the letter a will have to be represented by H; this alphabet, then, will be the H-alphabet if the cipher is Vigenère. The letter H has a frequency of only 1, which, in normal text, is not particularly satisfactory as the frequency of a, but this frequency count has not been taken from normal continuous text; suppose we examine the rest of the alphabet, and find out what the frequencies would be for other letters. Beginning at H, and calling letters in the order a, b, c, we find that this fifth alihabet, provided it is the H-alphabet, will contain: 3 d’s, 7 e’s, 2 h’s, 2 l’s, 2 o’s, 3 r’s, 3 t’s, and 3 y’s. That is, each letter present which shows a frequency greater than 1 will represent some plaintext original which, normally, is of some frequency, the only exception being y, which is a vowel. This is the best we can expect of any columnar frequency count made on only 34 letters; but more convincing still, and more reliable, is the fact that out of the entire group j k q x z we find only x, represented once. Alphabet 5, then, is entirely acceptable as the H-alphabet of the Vigenère cipher.

Let us see what we can find out about alphabet 3. Here, the strongly predominant letter is U. But when we attempt to identify this as e, we find that we should have to accept an alphabet containing 3 q’s, 2 x’s, and 3 z’s, all occurring in only thirty-odd letters of text. We meet with similar trouble when we attempt to identify U as t, as a, as o, and so on. It is not until we try it as s that we have good luck, finding only a series of blanks to represent the letters b, j, k, q, v, w, x, and z. And if U represents s, this alphabet begins at C. Alphabet 3, then, is entirely acceptable as the C-alphabet of the Vigenère cipher, and we have two of the key-letters: * * C * H.

In alphabet 1, the leading letter, N, is not so strongly predominant, and yet, when we assume it as the substitute for e, we find that the rest of the count is satisfactory. Alphabet 1, then, is acceptable as the J-alphabet of the Vigenère cipher and we have three of the key-letters: J * C * H.

In alphabet 2, we find no one leading letter, but the two most prominent frequencies are standing opposite E and S, as if this count might represent the normal alphabet itself. The absence of O and the presence of only one T is hardly significant in a columnar count; but further examination shows an excess of M’s and W’s, and this is more disturbing. However, a single K has appeared as the only representative of the group J K Q X Z; the low-frequency letters B and V have appeared but once each; and there is an absence of Y’s to counterbalance those which were too numerous in one of our other alphabets. So that a detailed examination, and the failure to identify this as any other alphabet, will lead to its tentative acceptance as the A-alphabet of the Vigenère cipher. (We can know definitely when we attempt to decipher with it.) With alphabet 2 accepted as the A-alphabet, we now have four of the key-letters: J A C * H. We shall return in a moment to consider the one which is still missing; but according to those present, it does not look as if our key is going to develop into a recognizable word.

Alphabets of the kind we saw in No. 2 can be much more satisfactorily identified by means of a graph. This graph, when the cipher is Vigenère, is no more than a picture of the normal frequency table. Ordinarily, it will be a strip of paper on which the normal alphabet has been written twice in succession, with a straight line standing at right angles to each letter, this line being long or short according to the normal frequency of its accompanying letter.

A description of one such graph, suggested by L. H. Patty, will serve to explain them all: Assuming that the several frequency counts are standing in a vertical position, as we see them in Fig. 105, and that the work has been done on quadrille paper, the graph will also be prepared vertically, and the strip of paper will be quadrille paper with squares of the same size, so that the spacing, vertically, will be the same for graph and frequency counts. The graph, however, will be twice the length of the frequency counts, and will carry the normal alphabet written twice in succession (except that the final Z can be omitted). The basis for frequencies can be 200, 100, or any other basis desired. If the basis is 200, each small square might represent a frequency of 5, so that a horizontal line placed beside E (frequency 24), would have a length of nearly five of the small squares. Or, if the basis is 100, each small square might represent a frequency of 2, and the horizontal line placed beside E (frequency 12), would have a length of six of the small squares. Or, if this same graph is being made on a typewriter, we might dispense with the horizontal lines and use a series of diagonals (or 1’s, or asterisks), after the manner of tally-marks, using whatever number of these is the actual frequency of the letter per 200, or per 100; this will give a good clear picture of the normal frequency count. It is understood that the upper and lower halves of the graph are to be prepared exactly alike, and that there is to be no skipping of extra spaces between them. Thus the graph, being twice the length of the frequency counts, and spaced to match them, can be moved up and down beside each one of these until some point is found at which the pattern of the given frequency count bears some resemblance to a pattern found somewhere on the graph. If no such pattern can be found, the conclusion is that the frequency count was not made on one of the simple shifted alphabets; however, due allowance must be made, as in the case of our alphabet 2, for the difference in length and for the fact that frequency counts of this kind have been made on columns. Patty’s graph, so far, is representing only the shifted normal alphabet; that is, the cipher alphabets belonging to Vigenère, variant, and Gronsfeld ciphers. If its horizontal lines be made very heavy, and retraced on the opposite side of the strip, and if the letters be written on that side, opposite exactly the same horizontal lines as before, the reverse side of the strip will furnish another graph for identifying the reversed alphabets of the Beaufort cipher. Other graphs can be prepared for other kinds of alphabets. For instance, a graph suitable for examining a series of Porta frequency counts could be made in two halves, each of double length; the A-to-M half would serve for comparison with the N-to-Z halves of the frequency counts, and vice versa.

Figure 106

Another Tabulation for Finding the Period EDWIN LINDQUIST

Repeated Interval List of all PRIME Factors..... Sequence 2 3 5 7 11....(Etc.)

J C V 24 111 1 C V 13 D D V 36 11 11 D S 12 11 1 S S 8 111 D T J 60 11 1 1 T J 48 1111 1

This was based on a cryptogram whose period was 12. The PRIME FACTOR 2 is obviously included twice, and the PRIME FACTOR 3 once.

* * *

The Vigenère cipher, and, in particular, the Kasiski method of solution, have given rise to much research among members of the American Cryptogram Association. We doubt that any of this research has ever resulted in any new or valuable discovery. Yet it is interesting in that it shows a body of amateurs arriving at devices which are fully as effective or convenient as those proposed by seasoned cryptanalysts. Carter’s “discovery,” for instance, which we saw in Fig. 90, was purely his own device; at that time, he had never heard of the “probable word method” proposed by Commandant Bazeries, one of the greatest of modern cryptanalysts. A great many of the first suggestions were directed at methods for making the trigram-search less tedious; these were largely duplications of a same idea, involving the use either of a tableau or of a slide; one example will be shown in the next chapter. The use of graphs, also, was a sort of simultaneous “invention.” As to Kasiski processes, while Ohaver’s tabulation had been published, it had been out of print and was not available for several years. The only information to be had was the fact that a period could be discovered by factoring intervals between repetitions, and Edwin Lindquist, finding this rather vague, devised for his own use the tabulation which is shown as Fig. 106. This tabulation was made from a cryptogram in which the period was 12. Lindquist, instead of preparing columns for all possible factors, prepared them only for prime factors, the repeated sequences and their separating intervals being listed in about the same way as in Ohaver’s tabulation. Now, taking one of the intervals, as 24: Tally in column 2, and the interval is reduced to 12. Tally again in column 2, and the interval is reduced to 6. Tally again in column 2, and the interval is reduced to 3, which is itself a prime factor. Tally a final time in column 3, and the interval 24 has been reduced to its prime factors. This process is almost entirely mental, and very rapid. Examining the results: Columns 2 and 3 are very full, indicating that prime factors 2 and 3 are both included in the period. But in column 3, the tallies are largely single, indicating that this factor is included only once in the period; while, in column 2, the tallies are largely in pairs, indicating that this factor is probably included twice in the period; had it been included three times, it would have shown up oftener in threes. Conclusion: The period is 2 x 2 x 3, which is 12. This tabulation will be found fully as convenient as Ohaver’s, and its results fully as accurate.

Figure 107

The "SHIFT" Method for Identifying Alphabet 4 EDWIN LINDQUIST

Letters apparently of the high-frequency class: I O P U

Their possible originals................E T A O N I R S H Amount of SHIFT if I represents.. 4 15 8 20 21 0 17 16 1* " " " " O " .. 10 21 14 0 1* 6 23 22 7 " " " " P " .. 11 22 15 1* 2 7 24 23 8 " " " " U " .. 18 1* 20 6 7 12 3 2 13

A SHIFT of 1 (the B-alphabet) makes all four of these letters the substitutes for high-frequency originals. It almost certainly the shift which was made.

Mr. Lindquist also developed his own method for identifying alphabets. This method, which, in theory, is graphic, is not particularly applicable to the kind of alphabets we have been considering; that is, it would not be needed when there is so much material. But for shorter examples, where alphabets contain only ten or fifteen letters each, it comes close to being that magical thing referred to by Lamb, a “mechanical crypt-solver.” This method can be examined in Fig. 107, where it is being applied to our so-far unidentified alphabet 4. An examination of this alphabet 4 (of Fig. 105) shows that it has four letters of more prominence than the rest: I, O, P, U. These letters, or most of them, should represent high-frequency originals; and our method consists in examining them collectively in order to find out what amount of “shift” must have taken place in order that some four of the letters E T A O N I R S H would have resulted in these four particular substitutes. The word “shift” is best understood by picturing the movement of the lower alphabet on a Saint-Cyr slide. If the two A’s are together, this is the starting position, and the “amount of shift” is zero. If the B-alphabet be moved into position, we have a shift of 1; if the C-alphabet be moved into position, we have a shift of 2; and so on. These “shift-numbers,” 0 to 25, can be written below the letters of the sliding alphabet.