Join 36000+ teachers and students using TTIO.
The Vernam cipher is, at least theoretically, considered a perfect cipher. Rather than using a single key, each plaintext character is encrypted using its own key. This key — or key stream — is randomly generated or is taken from a one-time pad, e.g. a page of a book. Read more here: https://www.cryptomuseum.com/crypto/vernam.htm
As introduction to stream ciphers, and to demonstrate that a perfect cipher does exist, we describe the Vernam Cipher, also known as the one-time-pad.
Gilbert Vernam invented and patented his cipher in 1917 while working at AT&T. The teletype had been recently introduced, and along with this the commerical Baudot code. Now messages were uniformly thought of as streams of zero's and one's (But the word "bit" was not yet invented. This is due to Shannon in the 40's.)
Vernam proposed a bit-wise exclusive or of the message stream with a truely random zero-one stream which was shared by sender and receipient.
SENDING ------- message: 0 0 1 0 1 1 0 1 0 1 1 1 ... pad: 1 0 0 1 1 1 0 0 1 0 1 1 ... XOR --------------------------- cipher: 1 0 1 1 0 0 0 1 1 1 0 0 ... RECEIVING --------- cipher: 1 0 1 1 0 0 0 1 1 1 0 0 ... pad: 1 0 0 1 1 1 0 0 1 0 1 1 ... XOR --------------------------- message: 0 0 1 0 1 1 0 1 0 1 1 1 ...
This cipher is unbreakable in a very strong sense. The intuition is that any message can be transformed into any cipher (of the same length) by a pad, and all transformations are equally likely. Given a two letter message, there is a pad which adds to the message to give OK, and another pad which adds to the message to give NO. Since either of these pads are equally likely, the message is equally likely to be OK or NO.
www.teachyourselfpython.com