A one-time pad is a type of encryption algorithm used in cryptography, where the key that encrypts and decrypts the message is used only one time. Obviously, a one-time pad, sometimes shortened to OTP, is not the most efficient use of resources. The one-time pad requires just as many resources to create it as a multiple-use key, but it must be destroyed after one use. When proper procedures are followed, however, the OTP is impossible to break because each one is different, making it worthwhile to create in certain situations.
Essentially, cryptography is the process of hiding information, and a one-time pad is a tool used to hide the data inside a code. When using cryptography, one person would encrypt a message, which involves applying an OTP or another type of key to the message. The person receiving the message would then use the key to decrypt and read the message. Many people think of cryptography only as a method by which governments and military groups create a code for disguising messages. Different types of cryptography are used to hide information in a variety of formats, however, such as with computer passwords and ATM cards.
To be considered a perfect one-time pad, the key must contain exactly as much data as the text to be encrypted, also called the plaintext. Only two copies of the key may exist, one for the sender and one for the receiver, and both parties must destroy the key upon decryption of the message. Finally, the key must be random. Some "random-number generators" on computers actually follow a pattern to generate the numbers, only giving the appearance of being random.
When used properly, the one-time pad is considered perfectly secure because someone attempting to decipher the code could not rely on other codes or messages for clues. A cryptanalyst is able to compare and contrast several messages that employ a multiple-use key, applying statistical analysis or pattern matching and eventually solving the key. With a one-time key, however, the only clues are in the single message, making it impossible for the cryptanalyst to break the key.
The term "pad" refers to the time when the code was printed on a pad of paper filled with random OTP codes. After using the code one time, the top sheet of the pad would be destroyed, revealing the next code for the next one-time pad. Computers randomly generate today's OTPs, as they have for many years.