The Vernam Cipher
In modern terminology, a Vernam cipher is a symmetrical stream cipher in which the plaintext is combined with a random or pseudorandom stream of data (the "keystream") of the same length, to generate the ciphertext, using the Boolean "exclusive or" (XOR) function. This is symbolised by ⊕ and is represented by the following "truth table", where + represents "true" and - represents "false".
INPUT | OUTPUT | |
A | B | A ⊕ B |
- | - | - |
- | + | + |
+ | - | + |
+ | + | - |
Other names for this function are: Not equal (NEQ), modulo 2 addition (without 'carry') and modulo 2 subtraction (without 'borrow').
The cipher is reciprocal in that the identical keystream is used both to encipher plaintext to ciphertext and to decipher ciphertext to yield the original plaintext:
-
-
-
- Plaintext ⊕ Key = Ciphertext
-
-
and:
-
-
-
- Ciphertext ⊕ Key = Plaintext
-
-
If the keystream is truly random and used only once, this is effectively a one-time pad. Substituting pseudorandom data generated by a cryptographically secure pseudo-random number generator is a common and effective construction for a stream cipher. RC4 is an example of a Vernam cipher that is widely used on the Internet.
If, however, the keystream is used for two messages, known to cryptanalysts as a depth, the effect of the keystream can be eliminated, leaving the two plaintexts XORed together. The result is equivalent to a Running key cipher and the two plaintexts may be separated by linguistic cryptanalytical techniques.
-
-
-
- Ciphertext1 ⊕ Ciphertext2 = Plaintext1 ⊕ Plaintext2
-
-
An operator's mistake of this sort famously allowed the Cryptanalysis of the Lorenz cipher by the British at Bletchley Park during World War II. They diagnosed how the keystream was generated, worked out how to break the cipher, and read vast quantities of high-level messages to and from German high command without ever seeing an actual Lorenz machine.
Read more about this topic: Gilbert Vernam
Famous quotes containing the word cipher:
“It is not an arbitrary decree of God, but in the nature of man, that a veil shuts down on the facts of to-morrow; for the soul will not have us read any other cipher than that of cause and effect. By this veil, which curtains events, it instructs the children of men to live in to-day.”
—Ralph Waldo Emerson (18031882)