The Vernam cipher is the only cipher in the world that cannot be broken, even though its principle is relatively simple. Its procedure was patented in 1917 by Gilbert Vernam. It consists of shifting each character of a message by a random number of digits in the alphabet. This is practically equivalent to substituting a completely random letter, and the proof that Vernam's cipher is unbreakable in principle is based on this fact.
For simplicity, we use the individual letters of the secret message and move each of them a few positions in the alphabet. For example, the first letter is shifted by 1 position, the second by 2, the third by 3, the fourth by 4. When we go beyond the end of the alphabet, we continue from the beginning of the alphabet. This gives the ciphertext BJRN from the word AHOJ. The sequence 1,2,3,4 is the key to decipher the message. Those who know it can easily move the letters in the opposite direction and get the original text. Without knowing the key, cracking the intercepted message is impossible.
Statistical cryptanalysis is made impossible by the random nature of the ciphertext. No information
about the frequency of characters in the original message, or relationships between groups of
characters, etc., can be gleaned from it, because each letter produces another completely randomly
chosen letter.
Even a brute force attack, to which virtually no other cipher is resistant, will not succeed. Even if
the attacker has unlimited computing power, quantum computers, etc., and can systematically try all
possible keys of length
x, the result of the effort will be only a sequence of all possible messages of length x
. He will not be able to find the right one among them, he will not get any information about it. Nor
will the order in which he obtained the messages tell the attacker anything, since, assuming a random
choice of key, it is also completely random.
Gilbert Vernam claimed to be certain that his cipher was unbreakable. But it was not until C. E. Shannon came up with an exact proof in 1949. The proof is based on the fact that a random shift in the alphabet is equivalent to substituting a completely random letter, and therefore the ciphertext cannot be distinguished from a completely random sequence. If we consider the secret message to be a random variable A and the key to be a random variable B that has a uniform distribution and is independent of A, then the encrypted message is also a random variable with a uniform distribution that is independent of A. In other words, the ciphertext does not contain any information about the original message, and therefore, in principle, the attacker has no chance to find out anything.