Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21eaa95ce364f87

Jump to content

Running key cipher

From Wikipedia, the free encyclopedia

In classical cryptography, the running key cipher is a type of polyalphabetic substitution cipher in which a text, typically from a book, is used to provide a very long keystream.

The earliest description of such a cipher was given in 1892 by French mathematician Arthur Joseph Hermann (better known for founding Éditions Hermann). Usually, the book to be used would be agreed ahead of time, while the passage to be used would be chosen randomly for each message and secretly indicated somewhere in the message.

The term running key was introduced by William F. Friedman; it is distinct from progressive key (David Kahn's term for systems such as that of Trithemius, which cycle through every alphabet in a fixed order before repeating) or progressing key (Gaines' term for the same concept).[1][2]

An early cryptanalysis of a running-text key was carried out by Étienne Bazeries in 1899, when he read the enciphered dispatches of the conspirators around the Duke of Orléans. The dispatches were written in four-figure groups, each pair of digits standing for a letter through a Beaufort table, and the key was a continuous text: successive lines of Alfred de Musset's poem La Nuit de décembre, or a written-out date, selected according to the calendar date.[3][4][5] Because the key did not repeat over the short telegrams, their apparent periodicity was a chance effect, and Bazeries recovered the messages by guessing probable words.[3][6]

Example

[edit source]

The key text used is a portion of The C Programming Language (1978 edition), and the tabula recta is the tableau. The plaintext here is "Flee at once".

Page 63, line 1 is selected as the running key:

errors can occur in several places. A label has...

The running key is then written under the plaintext:

Plaintext fleeatonce
Running key ERRORSCANO
Ciphertext JCVSRLQNPS

The message is then sent as "JCVSR LQNPS". However, unlike a Vigenère cipher, if the message is extended, the key is not repeated; the key text itself (the text from The C Programming Language) is used as the key and can be extended for any arbitrary length. If the message is extended, such as, "Flee at once. We are discovered", then the running key continues as before:

Plaintext fleeatoncewearediscovered
Running key ERRORSCANOCCURINSEVERALPL
Ciphertext JCVSRLQNPSYGUIMQAWXSMECTO

To determine where to find the running key, a fake block of five ciphertext characters is subsequently added, with three denoting the page number, and two the line number, using A=0, B=1 etc. to encode digits. Such a block is called an indicator block. The indicator block will be inserted as the second last of each message. (Many other schemes are possible for hiding indicator blocks.) Thus page 63, line 1 encodes as "AGDAB" (06301).

This yields a final message of "JCVSR LQNPS YGUIM QAWXS AGDAB MECTO".

Variants

[edit source]

Modern variants of the running key cipher often replace the traditional tabula recta with bitwise exclusive or, operate on whole bytes rather than alphabetic letters, and derive their running keys from large files. Apart from possibly greater entropy density of the files, and the ease of automation, there is little practical difference between such variants and traditional methods.[citation needed]

The American Cryptogram Association uses "Running Key" for a constrained puzzle form, in which a 40–50-letter plaintext is split in half and its first half is used as the key for its second half.[7] Methods for solving this form are set out in the association's lessons.[8]

Gromark cipher

[edit source]

The "Gromark cipher" ("Gronsfeld cipher with mixed alphabet and running key") uses a running numerical key formed by adding successive pairs of digits.[9] The VIC cipher uses a similar lagged Fibonacci generator.

Security and cryptanalysis

[edit source]

A single message can be attacked with a probable word: a likely plaintext fragment is placed against each position of the ciphertext and the resulting key fragment tested for intelligibility, building up message and key alternately.[2][10][11][12]

Because both the message and the key are natural-language text, a running-key ciphertext can also be attacked statistically. That it can be solved at all shows English to be at least 50 percent redundant, since two texts are recovered from a ciphertext of half their combined length.[11]

Deavours estimated the unicity distance of a running-key Vigenère cipher in English to be eight letters, so that in principle a ciphertext longer than this has a unique solution.[13]

Bauer and Tate scored candidate (plaintext, key) pairs at each position using unsmoothed letter n-grams up to order 6; on 1,000-letter ciphertexts this recovered between 28.9% and 33.5% of characters, too few to read.[14]

Bauer and Gottloeb used a dictionary attack that lists every combination of valid words consistent with a ciphertext; ignoring grammar, the average number of such combinations rose from about 34 for a three-letter block to about 9,000 for a six-letter block, but grammatical constraints eliminate almost all of them.[15]

Griffing applied the Viterbi algorithm with a 6-gram letter model, recovering a median of about 87% of characters on 1,000-letter ciphertexts (and nearly all when the model was trained on the source texts) and found that a solution is generally possible when the combined redundancy of message and key exceeds about 50%.[16]

Reddy and Knight used blocked Gibbs sampling over a word-based language model, recovering about 88–93% of characters on 1,000-character ciphertexts, 42–58% on 100-character ciphertexts, and 17–26% on 10-character ciphertexts, and running much faster than Viterbi decoding. Short messages remain ambiguous, because several natural-language (plaintext, key) pairs can produce the same ciphertext. Recovering a running key enciphered with a secret keyword-mixed table instead of the tabula recta is an open problem.[17]

The cipher can be strengthened by enciphering with several independent texts in succession, an idea due to Shannon.[18] Diffie and Hellman noted that, because English is about 75 percent redundant, four successive running keys would be secure against all attacks;[11] Ryabko later proved that adding four or more independent English texts as the key gives a positive equivocation, so the cipher cannot be read without the key.[19] As the number of running keys grows, the modulo-26 sum tends to a random sequence, giving a one-time tape.[11]

When the same running key is used for several messages, the set can be solved "in depth": Friedman showed in 1918 that such messages can be recovered column by column, more quickly than they were enciphered.[10][12]

In February 2026, a 1,128-letter running-key challenge posted by Satoshi Tomokiyo was solved by Matthew Brown using a dictionary attack on long words followed by manual extension.[20]

Confusion

[edit source]

Because both ciphers classically employed novels as part of their key material, many sources confuse the book cipher and the running key cipher. They are really only very distantly related. The running key cipher is a polyalphabetic substitution, the book cipher is a homophonic substitution. Perhaps the distinction is most clearly made by the fact that a running cipher would work best of all with a book of random numbers, whereas such a book (containing no text) would be useless for a book cipher.

See also

[edit source]

Further reading

[edit source]
  • Gaines, Helen Fouché (1939). Elementary Cryptanalysis: A Study of Ciphers and Their Solution. American Photographic Publishing. p. 143.
  • Friedman, William F. (1918). Methods for the Solution of Running-Key Ciphers (PDF). Riverbank Publication No. 16. Geneva, Illinois: Riverbank Laboratories.
  • Tomokiyo, Satoshi (2026). "Solving Running Key Ciphers (Manually/Digitally)". Cryptiana.

References

[edit source]
  1. Bauer, Friedrich L. (2007). Decrypted Secrets: Methods and Maxims of Cryptology (4th, revised and extended ed.). Berlin: Springer. §2.3.3 (p. 36), §8.1.2 (p. 140). ISBN 978-3-540-24502-5.
  2. 1 2 Gaines, Helen Fouché (1939). Elementary Cryptanalysis: A Study of Ciphers and Their Solution. American Photographic Publishing. p. 143.
  3. 1 2 Bazeries, Étienne (1901). Les chiffres secrets dévoilés (in French). Paris: Charpentier et Fasquelle. ch. V, "Chiffre du duc d'Orléans en 1898–1899", pp. 114–119, 243–249.
  4. Reinach, Joseph (1905). Histoire de l'Affaire Dreyfus (in French). Vol. V. Paris: Charpentier et Fasquelle. p. 6, note 2.
  5. Candela, Rosario (1938). The Military Cipher of Commandant Bazeries. New York: Cardanus Press. p. 3.
  6. Kahn, David (1967). The Codebreakers. New York: Macmillan. p. 246.
  7. American Cryptogram Association. "Running Key" (PDF). ACA cipher types.
  8. LANAKI (1996). "Classical Cryptography Course, Lesson 13: Aperiodic Systems" (PDF). American Cryptogram Association.
  9. American Cryptogram Association. "Gromark" (PDF). ACA cipher types.
  10. 1 2 Friedman, William F. (1918) [reprinted 1979 by Aegean Park Press in The Riverbank Publications, Vol. 1]. Methods for the Solution of Running-Key Ciphers (PDF). Riverbank Publication No. 16. Geneva, Illinois: Riverbank Laboratories.
  11. 1 2 3 4 Diffie, Whitfield; Hellman, Martin E. (1979). "Privacy and Authentication: An Introduction to Cryptography" (PDF). Proceedings of the IEEE. 67 (3): 397–427. doi:10.1109/PROC.1979.11256.
  12. 1 2 Pommerening, Klaus. "Running-Text Ciphers – Cryptanalysis According to Friedman". Cryptology. Archived from the original on 2024-01-10.
  13. Deavours, Cipher A. (1977). "Unicity Points in Cryptanalysis". Cryptologia. 1 (1): 46–68. doi:10.1080/0161-117791832797.
  14. Bauer, Craig; Tate, Christian N. S. (2002). "A Statistical Attack on the Running Key Cipher". Cryptologia. 26 (4): 274–282. doi:10.1080/0161-110291890939.
  15. Bauer, Craig; Gottloeb, Elliott J. (2005). "Results of an Automated Attack on the Running Key Cipher". Cryptologia. 29 (3): 248–254. doi:10.1080/01611190508951301.
  16. Griffing, Alexander (2006). "Solving the Running Key Cipher with the Viterbi Algorithm". Cryptologia. 30 (4): 361–367. doi:10.1080/01611190600789117.
  17. Reddy, Sravana; Knight, Kevin (2012). "Decoding Running Key Ciphers". Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). pp. 80–84.
  18. Shannon, Claude E. (1949). "Communication Theory of Secrecy Systems". Bell System Technical Journal. 28 (4): 656–715. doi:10.1002/j.1538-7305.1949.tb00928.x.
  19. Ryabko, Boris (2018). "Properties of two Shannon's ciphers". Designs, Codes and Cryptography. 86: 989–995. arXiv:1605.00214. doi:10.1007/s10623-017-0372-2.
  20. Tomokiyo, Satoshi (2026). "Solving Running Key Ciphers (Manually/Digitally)". Cryptiana.