Running Key Cipher
   HOME

TheInfoList



OR:

In classical
cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
, the running key cipher is a type of
polyalphabetic substitution A polyalphabetic cipher is a substitution, using multiple substitution alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic cipher, though it is a simplified special case. The Enigma machine is more complex but i ...
cipher In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption—a series of well-defined steps that can be followed as a procedure. An alternative, less common term is ''encipherment''. To encipher or encode i ...
in which a text, typically from a book, is used to provide a very long
keystream In cryptography, a keystream is a stream of random or pseudorandom characters that are combined with a plaintext message to produce an encrypted message (the ciphertext). The "characters" in the keystream can be bit The bit is the most basic ...
. The earliest description of such a cipher was given in 1892 by French mathematician Arthur Joseph Hermann (better known for founding
Éditions Hermann Éditions Hermann () is a French publishing house founded in 1876, by the French professor of mathematics Arthur Hermann. It publishes books on science and the arts. ''Éléments de mathématique'' Hermann is noted for publishing several vol ...
). Usually, the book to be used would be agreed ahead of time, while the passage to be used would be chosen
random In common usage, randomness is the apparent or actual lack of definite pattern or predictability in information. A random sequence of events, symbols or steps often has no order and does not follow an intelligible pattern or combination. ...
ly for each message and secretly indicated somewhere in the message.


Example

The key text used is a portion of ''
The C Programming Language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming langu ...
'' (1978 edition), and the ''
tabula recta In cryptography, the ''tabula recta'' (from Latin language, Latin ''wikt:tabula#Latin, tabula wikt:rectus#Latin, rēcta'') is a square table of alphabets, each row of which is made by shifting the previous one to the left. The term was invented ...
'' 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: The message is then sent as "JCVSR LQNPS". However, unlike a
Vigenère cipher The Vigenère cipher () is a method of encryption, encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar cipher, whose increment is determined by the corresponding letter of another text, the key (crypt ...
, if the message is extended, the key is not repeated; the key text itself (the text from the ''
The C Programming Language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming langu ...
'') 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: 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

Modern variants of the running key cipher often replace the traditional ''tabula recta'' with bitwise
exclusive or Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (on ...
, operate on whole
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
s 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

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 Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic alg ...
encryption or in person. They may also be changed frequently without changing the running key book.)


Ciphertext appearing to be plaintext

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), 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 ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
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 Semantics is the study of linguistic Meaning (philosophy), meaning. It examines what meaning is, how words get their meaning, and how the meaning of a complex expression depends on its parts. Part of this process involves the distinction betwee ...
meaning.


Gromark cipher

The "Gromark cipher" (" Gronsfeld cipher with mixed alphabet and running key") uses a running numerical key formed by adding successive pairs of digits. The
VIC cipher The VIC cipher was a pencil and paper cipher used by the Soviet Union, Soviet spy Reino Häyhänen, codenamed "VICTOR". If the cipher were to be given a modern technical name, it would be known as a "straddling bipartite monoalphabetic substitut ...
uses a similar
lagged Fibonacci generator A Lagged Fibonacci generator (LFG or sometimes LFib) is an example of a pseudorandom number generator. This class of random number generator is aimed at being an improvement on the 'standard' linear congruential generator. These are based on a gener ...
.


Security and cryptanalysis

If the running key is truly random, never reused, and kept secret, the result is a
one-time pad The one-time pad (OTP) is an encryption technique that cannot be Cryptanalysis, cracked in cryptography. It requires the use of a single-use pre-shared key that is larger than or equal to the size of the message being sent. In this technique, ...
, a method that provides
perfect secrecy A cryptosystem is considered to have information-theoretic security (also called unconditional security) if the system is secure against adversaries with unlimited computing resources and time. In contrast, a system which depends on the computatio ...
(reveals no information about the plaintext). However, if (as usual) the running key is a block of text in a
natural language A natural language or ordinary language is a language that occurs naturally in a human community by a process of use, repetition, and change. It can take different forms, typically either a spoken language or a sign language. Natural languages ...
, 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 In cryptography, a ciphertext-only attack (COA) or known ciphertext attack is an attack model for cryptanalysis where the attacker is assumed to have access only to a set of ciphertexts. While the attacker has no channel providing access to the p ...
during WWI against most frequent letters encoded by other most frequent letters. As a result, the
entropy Entropy is a scientific concept, most commonly associated with states of disorder, randomness, or uncertainty. The term and the concept are used in diverse fields, from classical thermodynamics, where it was first recognized, to the micros ...
per character of both plaintext and running key is low, and the combining operation is easily inverted. To attack the cipher, a
cryptanalyst Cryptanalysis (from the Greek ''kryptós'', "hidden", and ''analýein'', "to analyze") refers to the process of analyzing information systems in order to understand hidden aspects of the systems. Cryptanalysis is used to breach cryptographic se ...
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 An autokey cipher (also known as the autoclave cipher) is a cipher that incorporates the message (the plaintext) into the key. The key is generated from the message in some automated fashion, sometimes by selecting certain letters from the text o ...
). Eventually it is likely that the source of the running key will be identified, and the jig is up. 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 In statistics, the frequency or absolute frequency of an Event (probability theory), event i is the number n_i of times the observation has occurred/been recorded in an experiment or study. These frequencies are often depicted graphically or tabu ...
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 The Committee for State Security (, ), abbreviated as KGB (, ; ) was the main security agency of the Soviet Union from 1954 to 1991. It was the direct successor of preceding Soviet secret police agencies including the Cheka, Joint State Polit ...
advised agents to use documents like
almanac An almanac (also spelled almanack and almanach) is a regularly published listing of a set of current information about one or multiple subjects. It includes information like weather forecasting, weather forecasts, farmers' sowing, planting dates ...
s 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 2^, which by computer cryptography standards is a relatively easy target. (See permutation generated running keys above for an approach to this problem).


Confusion

Because both ciphers classically employed
novel A novel is an extended work of narrative fiction usually written in prose and published as a book. The word derives from the for 'new', 'news', or 'short story (of something new)', itself from the , a singular noun use of the neuter plural of ...
s as part of their key material, many sources confuse the
book cipher A book cipher is a cipher in which each word or letter in the plaintext of a message is replaced by some code that locates it in another text, the key. A simple version of such a cipher would use a specific book as the key, and would replace ea ...
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

*
Polyalphabetic substitution A polyalphabetic cipher is a substitution, using multiple substitution alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic cipher, though it is a simplified special case. The Enigma machine is more complex but i ...
*
Substitution cipher In cryptography, a substitution cipher is a method of encrypting in which units of plaintext are replaced with the ciphertext, in a defined manner, with the help of a key; the "units" may be single letters (the most common), pairs of letters, t ...
*
Book cipher A book cipher is a cipher in which each word or letter in the plaintext of a message is replaced by some code that locates it in another text, the key. A simple version of such a cipher would use a specific book as the key, and would replace ea ...
*
Topics in cryptography The following outline is provided as an overview of and topical guide to cryptography: Cryptography (or cryptology) – practice and study of hiding information. Modern cryptography intersects the disciplines of mathematics, computer scie ...


References

{{Reflist Stream ciphers Classical ciphers