Recent from talks
Nothing was collected or created yet.
Running key cipher
View on WikipediaThis article needs additional citations for verification. (March 2016) |
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.
Example
[edit]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 | f | l | e | e | a | t | o | n | c | e |
|---|---|---|---|---|---|---|---|---|---|---|
| Running key | E | R | R | O | R | S | C | A | N | O |
| Ciphertext | J | C | V | S | R | L | Q | N | P | S |
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 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 | f | l | e | e | a | t | o | n | c | e | w | e | a | r | e | d | i | s | c | o | v | e | r | e | d |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Running key | E | R | R | O | R | S | C | A | N | O | C | C | U | R | I | N | S | E | V | E | R | A | L | P | L |
| Ciphertext | J | C | V | S | R | L | Q | N | P | S | Y | G | U | I | M | Q | A | W | X | S | M | E | C | T | O |
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]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.
Permutation generated running keys
[edit]A more compact running key can be used if one combinatorially generates text using several start pointers (or combination rules). For example, rather than start at one place (a single pointer), one could use several start pointers and xor together the streams to form a new running key, similarly skip rules can be used. What is exchanged then is a series of pointers to the running key book and/or a series of rules for generating the new permuted running key from the initial key text. (These may be exchanged via public key encryption or in person. They may also be changed frequently without changing the running key book.)
Ciphertext appearing to be plaintext
[edit]Traditional ciphertext appears to be quite different from plaintext. To address this problem, one variant outputs "plaintext" words instead of "plaintext" letters as the ciphertext output. This is done by creating an "alphabet" of words (in practice multiple words can correspond to each ciphertext output character). The result is a ciphertext output which looks like a long sequence of plaintext words (the process can be nested). Theoretically, this is no different from using standard ciphertext characters as output. However, plaintext-looking ciphertext may result in a "human in the loop" to try to mistakenly interpret it as decoded plaintext.
An example would be BDA (Berkhoff deflater algorithm)[citation needed], each ciphertext output character has at least one noun, verb, adjective and adverb associated with it. (E.g. (at least) one of each for every ASCII character). Grammatically plausible sentences are generated as ciphertext output. Decryption requires mapping the words back to ASCII, and then decrypting the characters to the real plaintext using the running key. Nested-BDA will run the output through the reencryption process several times, producing several layers of "plaintext-looking" ciphertext - each one potentially requiring "human-in-the-loop" to try to interpret its non-existent semantic meaning.
Gromark cipher
[edit]The "Gromark cipher" ("Gronsfeld cipher with mixed alphabet and running key") uses a running numerical key formed by adding successive pairs of digits.[1] The VIC cipher uses a similar lagged Fibonacci generator.
Security and cryptanalysis
[edit]If the running key is truly random, never reused, and kept secret, the result is a one-time pad, a method that provides perfect secrecy (reveals no information about the plaintext). However, if (as usual) the running key is a block of text in a natural language, security actually becomes fairly poor, since that text will have non-random characteristics which can be used to aid cryptanalysis: for example, William F. Friedman suggested a ciphertext-only attack during WWI against most frequent letters encoded by other most frequent letters.[2] As a result, the entropy per character of both plaintext and running key is low, and the combining operation is easily inverted.
To attack the cipher, a cryptanalyst may run guessed probable plaintexts along the ciphertext, subtracting them out from each possible position. When the result is a chunk of something intelligible, there is a high probability that the guessed plain text is correct for that position (as either actual plaintext, or part of the running key). The 'chunk of something intelligible' can then often be extended at either end, thus providing even more probable plaintext, which can in turn be extended, and so on (for more detailed explanation refer to Autokey cipher). Eventually it is likely that the source of the running key will be identified, and the entire message can be deciphered.
There are several ways to improve the security. The first and most obvious is to use a secret mixed alphabet tableau instead of a tabula recta. This does indeed greatly complicate matters but it is not a complete solution. As exploited in Friedman's method, pairs of plaintext and running key characters are far more likely to be high frequency pairs such as 'EE' rather than, say, 'QQ'. The skew this causes to the output frequency distribution is smeared by the fact that it is quite possible that 'EE' and 'QQ' map to the same ciphertext character, but nevertheless the distribution is not flat. This may enable the cryptanalyst to deduce part of the tableau, then proceed as before (but with gaps where there are sections missing from the reconstructed tableau).
Another possibility is to use a key text that has more entropy per character than typical English. For this purpose, the KGB advised agents to use documents like almanacs and trade reports, which often contain long lists of random-looking numbers.
Another problem is that the keyspace is surprisingly small. Suppose that there are 100 million key texts that might plausibly be used, and that on average each has 11 thousand possible starting positions. To an opponent with a massive collection of possible key texts, this leaves possible a brute force search of the order of , which by computer cryptography standards is a relatively easy target. (See permutation generated running keys above for an approach to this problem).
Confusion
[edit]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]References
[edit]- ^ American Cryptogram Association. "The ACA and You" Archived 2016-04-03 at the Wayback Machine. 2016.
- ^ "Cryptology: Running-Text Ciphers – Cryptanalysis According to Friedman". www.staff.uni-mainz.de. Retrieved 2024-01-10.
Running key cipher
View on GrokipediaPrinciples and Operation
Definition and Core Concepts
A running key cipher is a polyalphabetic substitution cipher that utilizes a non-repeating keystream of arbitrary length, typically generated from an external text source such as a book or document shared between correspondents.[5][6] This approach contrasts with fixed-key systems by drawing successive key letters directly from the chosen text, ensuring the keystream matches the plaintext length without cycling or repetition.[7] At its core, the running key functions as a continuous keystream that progresses sequentially through the source text, pairing each plaintext character with a distinct key character to produce the ciphertext.[8] This one-to-one correspondence eliminates the periodic patterns inherent in repeating-key polyalphabetics, such as the Vigenère cipher, thereby complicating frequency-based attacks.[8] The substitution mechanism employs the tabula recta, a square table of alphabets where each row represents a shifted version of the base alphabet, facilitating letter-by-letter encryption through addition in modular arithmetic.[6] Letters are numerically encoded with A=0, B=1, up to Z=25, and the shift for each position is computed modulo 26, yielding a new ciphertext letter: for plaintext letter and key letter , the ciphertext is .[6] Running key ciphers played a pivotal role in historical cryptography as a transitional method between limited-key polyalphabetics and modern stream ciphers, introducing the use of extended, non-repeating keystreams for enhanced diffusion.[8] Predating digital computing, they influenced early 20th-century mechanical systems, including the U.S. Army's M-94 cipher wheel, which adapted polyalphabetic principles for tactical use.[9]Encryption and Decryption Process
The encryption process in a running key cipher involves aligning the plaintext message letter by letter with a corresponding sequence from the running key, which is typically derived from a lengthy, non-repeating text source such as a book excerpt. Each plaintext letter is converted to its numeric equivalent (A=0, B=1, ..., Z=25), and similarly for the key letter . The ciphertext letter is then computed using the formula , after which the result is mapped back to the corresponding letter in the alphabet.[10][11] This addition can be performed manually via a tabula recta or computationally in modern implementations.[10] Decryption reverses this operation by aligning the ciphertext with the same running key sequence. For each position, the ciphertext numeric value is subtracted by the key value , yielding , with negative results adjusted by adding 26 to ensure a non-negative value within the 0-25 range before mapping back to plaintext letters.[10][11] This modular subtraction maintains the cipher's reversibility, assuming perfect key alignment. A fundamental requirement is that the running key must be at least as long as the plaintext to prevent repetition and enhance security, effectively making the key stream unique for each message.[10][11] Sender and receiver must synchronize the key source in advance, often by agreeing on a specific book, page, and starting line, which can be indicated subtly in the message preamble to avoid direct transmission of the key itself.[11] In contemporary computational settings, the process is implemented programmatically by generating the key stream from digitized texts, automating the modulo operations for efficiency while preserving the manual synchronization protocol.[10]Historical Development
Origins in Polyalphabetic Ciphers
The running key cipher emerged from the evolution of polyalphabetic substitution ciphers, which originated in the 16th century with innovations like those described by Blaise de Vigenère in his 1586 treatise Traicté des chiffres et chiffres secrets. Vigenère's work included an autokey variant, where an initial keyword is extended by the plaintext itself to create a non-repeating keystream, representing an early attempt to avoid key periodicity in polyalphabetic systems. However, the running key cipher, using a long external text such as a book excerpt as the keystream, was first formally described in 1892 by French mathematician Arthur-Joseph Hermann in his work Nouveau système de correspondance secrète.[4] This approach built on earlier polyalphabetic designs but provided a truly aperiodic key independent of the message.[12] In the 19th century, advancements in cryptanalysis highlighted the vulnerabilities of short-key polyalphabetics. Charles Babbage developed methods in the 1840s to break Vigenère ciphers by identifying repeated sequences and aligning them to reveal the key length, showing how periodicity facilitated attacks. Friedrich Kasiski's 1863 examination technique systematically detected repeated ciphertext trigrams to deduce key length, underscoring the need for keys as long as the plaintext to resist such methods.[13] These developments influenced the pursuit of non-repeating keys, paving the way for running key systems. The early 20th century saw the adoption of running key ciphers in military contexts, with the U.S. Army Signal Corps incorporating them into field manuals around 1917 for secure telegraph and radio communications. These manuals described running keys, often derived from book passages or continuous text, as non-repeating alternatives to periodic ciphers, suitable for World War I operations.[9] Concurrently, AT&T engineer Gilbert Vernam proposed a related system in 1917 for telegraphy encryption, using a prepared key tape combined character-by-character with plaintext via XOR-like addition, functioning as a running key but initially with reusable loops, later refined into the one-time pad by Vernam and Joseph Mauborgne.[14] Pre-World War II European developments included German Abwehr experiments with mechanical running key devices, such as the Kryha machine invented by Fritz Kryha in the 1920s and adopted for intelligence communications. This clockwork encipherer generated pseudo-random key streams via movable alphabet tabs, offering a portable, non-periodic alternative to rotor machines like Enigma for low-volume traffic, though it was eventually compromised by Allied cryptanalysts.[15]Evolution and Notable Uses
Following World War I, running key ciphers evolved through integration with mechanical aids, though many remained manual for practicality in military use. During World War II, running key ciphers found niche applications in espionage, particularly by British Special Operations Executive (SOE) agents, who employed poem codes—a form of book cipher using memorized or carried verses as keys for transposition to encode short radio messages to London. German intelligence adopted book-based running keys more selectively, such as the Spanish book Sonar la Vida for the Hamburg-Chile circuit or O Servo de Deua for Hamburg-Lisbon reports on Allied shipping, but logistical challenges like irregular traffic and synchronized editions limited use; mechanical variants like the Kryha device were employed commercially and diplomatically but saw restricted military deployment.[15] A notable event occurred in 1943 when Allied cryptanalysts, including the U.S. Coast Guard and British ISOS section, broke several Axis running key systems through known-plaintext attacks, identifying key books from message preambles and patterns to decrypt 150-200 daily intercepts, revealing intelligence on ship movements and agent activities.[15] Post-war, running key ciphers declined with the rise of rotor machines and electronic systems, yet their simplicity influenced manual field operations in non-aligned countries during the Cold War, where resource limitations favored book-based methods.Illustrative Examples
Basic Numerical Example
To illustrate the core mechanics of the running key cipher using numerical values, consider a simplified plaintext "FLEEA" (corresponding to "Flee a" with space ignored), mapped to integers where A=0, B=1, ..., Z=25, yielding plaintext values . A non-repeating running key of equal length, derived from the start of the phrase "errors can occur" (e=4, r=17, r=17, o=14, r=17), is used instead of a short repeating key as in the Vigenère cipher.[11] Encryption computes each ciphertext value as , where is the -th key value. The following table shows the step-by-step calculation:| Position | Plaintext Letter | Key Letter | Ciphertext Letter | |||
|---|---|---|---|---|---|---|
| 1 | F | 5 | e | 4 | 9 | J |
| 2 | L | 11 | r | 17 | 28 \mod 26 = 2 | C |
| 3 | E | 4 | r | 17 | 21 | V |
| 4 | E | 4 | o | 14 | 18 | S |
| 5 | A | 0 | r | 17 | 17 | R |
