In
cryptography, the one-time pad (OTP) is an
encryption technique that cannot be
cracked, but requires the use of a single-use
pre-shared key In cryptography, a pre-shared key (PSK) is a shared secret which was previously shared between the two parties using some secure channel before it needs to be used.
Key
To build a key from shared secret, the key derivation function is typically us ...
that is not smaller than the message being sent. In this technique, a
plaintext is paired with a random secret
key
Key or The Key may refer to:
Common meanings
* Key (cryptography), a piece of information that controls the operation of a cryptography algorithm
* Key (lock), device used to control access to places or facilities restricted by a lock
* Key (map ...
(also referred to as ''a one-time pad''). Then, each bit or character of the plaintext is encrypted by combining it with the corresponding bit or character from the pad using
modular addition.
The resulting
ciphertext will be impossible to decrypt or break if the following four conditions are met:
#The key must be at least as long as the plaintext.
#The key must be random (
uniformly distributed in the set of all possible keys and
independent of the plaintext), entirely sampled from a non-algorithmic, chaotic source such as a
hardware random number generator. It is not sufficient for OTP keys to pass
statistical randomness tests as such tests cannot measure entropy, and the number of bits of entropy must be at least equal to the number of bits in the plaintext. For example, using cryptographic hashes or mathematical functions (such as logarithm or square root) to generate keys from fewer bits of entropy would break the uniform distribution requirement, and therefore would not provide perfect secrecy.
#The key must never be reused in whole or in part.
#The key must be kept completely
secret by the communicating parties.
It has also been mathematically proven that any cipher with the property of perfect secrecy must use keys with effectively the same requirements as OTP keys.
Digital versions of one-time pad ciphers have been used by nations for critical
diplomatic
Diplomatics (in American English, and in most anglophone countries), or diplomatic (in British English), is a scholarly discipline centred on the critical analysis of documents: especially, historical documents. It focuses on the conventions, p ...
and
military communication, but the problems of secure
key distribution In symmetric key cryptography, both parties must possess a secret key which they must exchange prior to using any encryption. Distribution of secret keys has been problematic until recently, because it involved face-to-face meeting, use of a trust ...
make them impractical for most applications.
First described by
Frank Miller in 1882,
the one-time pad was re-invented in 1917. On July 22, 1919, U.S. Patent 1,310,719 was issued to
Gilbert Vernam for the
XOR
Exclusive or or exclusive disjunction is a logical operation that is true if and only if its arguments differ (one is true, the other is false).
It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, , ...
operation used for the encryption of a one-time pad.
Derived from his ''Vernam cipher'', the system was a cipher that combined a message with a key read from a
punched tape. In its original form, Vernam's system was vulnerable because the key tape was a loop, which was reused whenever the loop made a full cycle. One-time use came later, when
Joseph Mauborgne recognized that if the key tape were totally random, then
cryptanalysis
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 sec ...
would be impossible.
The "pad" part of the name comes from early implementations where the key material was distributed as a pad of paper, allowing the current top sheet to be torn off and destroyed after use. For concealment the pad was sometimes so small that a powerful
magnifying glass
A magnifying glass is a convex lens that is used to produce a magnified image of an object. The lens is usually mounted in a frame with a handle. A magnifying glass can be used to focus light, such as to concentrate the sun's radiation to crea ...
was required to use it. The
KGB used pads of such size that they could fit in the palm of a hand, or in a
walnut shell. To increase security, one-time pads were sometimes printed onto sheets of highly flammable
nitrocellulose, so that they could easily be burned after use.
There is some ambiguity to the term "Vernam cipher" because some sources use "Vernam cipher" and "one-time pad" synonymously, while others refer to any additive
stream cipher
stream cipher is a symmetric key cipher where plaintext digits are combined with a pseudorandom cipher digit stream (keystream). In a stream cipher, each plaintext digit is encrypted one at a time with the corresponding digit of the keystream ...
as a "Vernam cipher", including those based on a
cryptographically secure pseudorandom number generator (CSPRNG).
History
Frank Miller in 1882 was the first to describe the one-time pad system for securing telegraphy.
The next one-time pad system was electrical. In 1917,
Gilbert Vernam (of
AT&T Corporation) invented and later patented in 1919 () a cipher based on
teleprinter technology. Each character in a message was electrically combined with a character on a
punched paper tape
Five- and eight-hole punched paper tape
Paper tape reader on the Harwell computer with a small piece of five-hole tape connected in a circle – creating a physical program loop
Punched tape or perforated paper tape is a form of data storage ...
key.
Joseph Mauborgne (then a
captain
Captain is a title, an appellative for the commanding officer of a military unit; the supreme leader of a navy ship, merchant ship, aeroplane, spacecraft, or other vessel; or the commander of a port, fire or police department, election precinct, e ...
in the
U.S. Army and later chief of the
Signal Corps) recognized that the character sequence on the key tape could be completely random and that, if so, cryptanalysis would be more difficult. Together they invented the first one-time tape system.
The next development was the paper pad system. Diplomats had long used codes and ciphers for confidentiality and to minimize
telegraph costs. For the codes, words and phrases were converted to groups of numbers (typically 4 or 5 digits) using a dictionary-like
codebook. For added security, secret numbers could be combined with (usually modular addition) each code group before transmission, with the secret numbers being changed periodically (this was called
superencryption). In the early 1920s, three German cryptographers (Werner Kunze, Rudolf Schauffler, and Erich Langlotz), who were involved in breaking such systems, realized that they could never be broken if a separate randomly chosen additive number was used for every code group. They had duplicate paper pads printed with lines of random number groups. Each page had a serial number and eight lines. Each line had six 5-digit numbers. A page would be used as a work sheet to encode a message and then destroyed. The
serial number
A serial number is a unique identifier assigned incrementally or sequentially to an item, to ''uniquely'' identify it.
Serial numbers need not be strictly numerical. They may contain letters and other typographical symbols, or may consist enti ...
of the page would be sent with the encoded message. The recipient would reverse the procedure and then destroy his copy of the page. The German foreign office put this system into operation by 1923.
A separate notion was the use of a one-time pad of letters to encode plaintext directly as in the example below.
Leo Marks describes inventing such a system for the British
Special Operations Executive during
World War II, though he suspected at the time that it was already known in the highly compartmentalized world of cryptography, as for instance at
Bletchley Park.
The final discovery was made by information theorist
Claude Shannon in the 1940s who recognized and proved the theoretical significance of the one-time pad system. Shannon delivered his results in a classified report in 1945 and published them openly in 1949.
At the same time, Soviet information theorist
Vladimir Kotelnikov
Vladimir Aleksandrovich Kotelnikov (russian: Владимир Александрович Котельников; 6 September 1908 in Kazan – 11 February 2005 in Moscow) was an information theory and radar astronomy pioneer from the Soviet Union ...
had independently proved the absolute security of the one-time pad; his results were delivered in 1941 in a report that apparently remains classified.
[ PACS numbers: 01.10.Fv, 03.67.Dd, 89.70.+c and openly in Russia]
Квантовая криптография и теоремы В.А. Котельникова об одноразовых ключах и об отсчетах. УФН
/ref>
Example
Suppose Alice and Bob, Alice wishes to send the message hello
to Bob. Assume two pads of paper containing identical random sequences of letters were somehow previously produced and securely issued to both. Alice chooses the appropriate unused page from the pad. The way to do this is normally arranged for in advance, as for instance "use the 12th sheet on 1 May", or "use the next available sheet for the next message".
The material on the selected sheet is the ''key'' for this message. Each letter from the pad will be combined in a predetermined way with one letter of the message. (It is common, but not required, to assign each letter a numerical value, e.g., a
is 0, b
is 1, and so on.)
In this example, the technique is to combine the key and the message using modular addition, not unlike the Vigenère cipher. The numerical values of corresponding message and key letters are added together, modulo 26. So, if key material begins with XMCKL
and the message is hello
, then the coding would be done as follows:
h e l l o message
7 (h) 4 (e) 11 (l) 11 (l) 14 (o) message
+ 23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key
= 30 16 13 21 25 message + key
= 4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z) (message + key) mod 26
E Q N V Z → ciphertext
If a number is larger than 25, then the remainder after subtraction of 26 is taken in modular arithmetic fashion. This simply means that if the computations "go past" Z, the sequence starts again at A.
The ciphertext to be sent to Bob is thus EQNVZ
. Bob uses the matching key page and the same process, but in reverse, to obtain the plaintext. Here the key is ''subtracted'' from the ciphertext, again using modular arithmetic:
E Q N V Z ciphertext
4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z) ciphertext
− 23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key
= −19 4 11 11 14 ciphertext – key
= 7 (h) 4 (e) 11 (l) 11 (l) 14 (o) ciphertext – key (mod 26)
h e l l o → message
Similar to the above, if a number is negative, then 26 is added to make the number zero or higher.
Thus Bob recovers Alice's plaintext, the message hello
. Both Alice and Bob destroy the key sheet immediately after use, thus preventing reuse and an attack against the cipher. The KGB often issued its agents one-time pads printed on tiny sheets of flash paper, paper chemically converted to nitrocellulose, which burns almost instantly and leaves no ash.
The classical one-time pad of espionage used actual pads of minuscule, easily concealed paper, a sharp pencil, and some mental arithmetic. The method can be implemented now as a software program, using data files as input (plaintext), output (ciphertext) and key material (the required random sequence). The exclusive or (XOR) operation is often used to combine the plaintext and the key elements, and is especially attractive on computers since it is usually a native machine instruction and is therefore very fast. It is, however, difficult to ensure that the key material is actually random, is used only once, never becomes known to the opposition, and is completely destroyed after use. The auxiliary parts of a software one-time pad implementation present real challenges: secure handling/transmission of plaintext, truly random keys, and one-time-only use of the key.
Attempt at cryptanalysis
To continue the example from above, suppose Eve intercepts Alice's ciphertext: EQNVZ
. If Eve tried every possible key, she would find that the key XMCKL
would produce the plaintext hello
, but she would also find that the key TQURI
would produce the plaintext later
, an equally plausible message:
4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z) ciphertext
− 19 (T) 16 (Q) 20 (U) 17 (R) 8 (I) possible key
= −15 0 −7 4 17 ciphertext-key
= 11 (l) 0 (a) 19 (t) 4 (e) 17 (r) ciphertext-key (mod 26)
In fact, it is possible to "decrypt" out of the ciphertext any message whatsoever with the same number of characters, simply by using a different key, and there is no information in the ciphertext that will allow Eve to choose among the various possible readings of the ciphertext.
If the key is not truly random, it is possible to use statistical analysis to determine which of the plausible keys is the "least" random and therefore more likely to be the correct one. If a key is reused, it will noticeably be the only key that produces sensible plaintexts from both ciphertexts (the chances of some random ''incorrect'' key also producing two sensible plaintexts are very slim).
Perfect secrecy
One-time pads are "information-theoretically secure
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 ...
" in that the encrypted message (i.e., the ciphertext) provides no information about the original message to a cryptanalyst (except the maximum possible length[The actual length of a plaintext message can hidden by the addition of extraneous parts, called padding. For instance, a 21-character ciphertext could conceal a 5-character message with some padding convention (e.g. "-PADDING- HELLO -XYZ-") as much as an actual 21-character message: an observer can thus only deduce the maximum possible length of the significant text, not its exact length.] of the message). This is a very strong notion of security first developed during WWII by Claude Shannon and proved, mathematically, to be true for the one-time pad by Shannon at about the same time. His result was published in the ''Bell System Technical Journal'' in 1949. Properly used, one-time pads are secure in this sense even against adversaries with infinite computational power.
Shannon proved, using information theoretic considerations, that the one-time pad has a property he termed ''perfect secrecy''; that is, the ciphertext ''C'' gives absolutely no additional information about the plaintext.[That is to say, the "information gain" or Kullback–Leibler divergence of the plaintext message from the ciphertext message is zero.] This is because (intuitively), given a truly uniformly random key that is used only once, a ciphertext can be translated into ''any'' plaintext of the same length, and all are equally likely. Thus, the '' a priori'' probability of a plaintext message ''M'' is the same as the ''a posteriori
("from the earlier") and ("from the later") are Latin phrases used in philosophy to distinguish types of knowledge, justification, or argument by their reliance on empirical evidence or experience. knowledge is independent from current ex ...
'' probability of a plaintext message ''M'' given the corresponding ciphertext.
Mathematically, this is expressed as , where is the information entropy of the plaintext and is the conditional entropy of the plaintext given the ciphertext ''C''. (Here, Η is the capital Greek letter eta.) This implies that for every message ''M'' and corresponding ciphertext ''C'', there must be at least one key ''K'' that binds them as a one-time pad. Mathematically speaking, this means must hold, where denote the quantities of possible keys, ciphers and messages, respectively. In other words, to be able to go from any plaintext in the message space ''M'' to any cipher in the cipher space ''C'' (via encryption) and from any cipher in cipher-space ''C'' to a plain text in message space ''M'' (decryption), it would require at least keys (with all keys used with equal probability of to ensure perfect secrecy).
Another way of stating perfect secrecy is that for all messages in message space ''M'', and for all ciphers ''c'' in cipher space ''C'', we have