The One Time Pad is not a cipher, but in fact is just a large collection of keys. These keys can be used in the encryption and decryption of messages, often using a Vigenère or modular addition method of encryption. The "pad" refers to a real pad of paper - each with an individual, unique key. "One time" refers to the fact that each of these papers would be used once - and only once. The only catch with the one time pad is that each key must be totally randomized, and the message sent using the key must be as long or shorter than the key - it cannot be longer. It was independently developed throughout the late 19th and early 20th centuries by Frank Miller and Gilbert Vernam.
The Vigenère Method: Encoding a message using a one time pad is no different than using a normal keyword. Just follow the same rules as applied when encoding with the Vigenère cipher.
The Modular Addition Method: Encoding a message using this method is incredibly easy after learning about modulo and modular arithmetic. It simply consists of four steps:
Here is an example of encryption with the message "CRYPTO" and the key "HARUEW".
Plaintext: C R Y P T O Plaintext: 3 (C) 18 (R) 25 (Y) 16 (P) 20 (T) 15 (O) Key: 8 (H) 1 (A) 18 (R) 21 (U) 5 (E) 23 (W) Addition: 11 (K) 19 (S) 43 ( ) 37 ( ) 25 (Y) 38 ( ) Modulo 26: 11 (K) 19 (S) 17 (Q) 11 (K) 25 (Y) 12 (L) Ciphertext: K S Q K Y L
The Vigenère Method: Once again, decoding a message using a one time pad is again not different than using a standards keyword. Simply follow the same rules when decoding using the Vigenère cipher.
The Modular Addition Method: When decoding a message encoded with the modular addition, simply follow the same steps as encryption, but this time, subtract the key from the ciphertext. If a number ends up below 1, add 26.
The One Time Pad is special, since unlike any other cipher in existence, the One Time Pad offers something incredibly unique: absolute guarenteed secrecy. It cannot be broken by any amount of cryptanalysis - no message can ever be intercepted by an enemy, irregardless of time or technology.
Some of you may ask, "How does using a One Time Pad ensure total secrecy, especially given that its method of encoding and decoding aren't that incredibly strong?" There are two things that separate a regular key from a One Time Pad key:
Imagine a 20-letter long message. That means we must generate a key that is 20 characters long. However, due to the randomness of the key, that means each letter could be any of the 26 characters in the alphabet. That means there are 2620 (ie 19,928,148,895,209,409,152,340,197,376) possible random keys that could be generated. This method of key generation is secure not only because it would take an impossibly long time for any human or computer to brute force every single key, but also in the fact that keys will be generated for other messages of the same length. Let's use our previous example: We have a ciphertext of "KSUKYL". Using our key, that creates the intended message of "CRYPTO", but using different keys, that could easily become "CASTLE" or "BOTTLE". Without context, a cryptanalyst has no way of determining which message was the intended one.
So if using the One Time Pad offers entirely secure communication, why isn't it used everywhere?
However, the One Time Pad has been used in communications that require absolute security between parties. For instance, communications between the Presidents of the United States and Russia are often secured using a One Time Pad. Furthermore, the spread of the internet means that the One Time Pad may possibly become increasingly feasible in the future. So while it remains entirely impractical for common use, it may not be for much longer.
Here is an example of an One Time Pad key that has been used by the National Security Agency of the United States.