OneTime Pads
Explore the concept of onetime pads and their usage in the Vigenère cipher.
A simple cryptosystem offering perfect secrecy is known as a onetime pad.
Properties of a onetime pad
Although there are many different versions and ways of describing a onetime pad, they all have the same three essential properties:

The number of possible keys is greater than or equal to the number of possible plaintexts: If the number of keys is less than the number of plaintexts, then guessing the key is easier than guessing the plaintext. This is why the cryptosystem doesn’t provide perfect secrecy. In most onetime pads, the number of possible keys is equal to the number of possible plaintexts.

The key is selected uniformly at random from the keyspace: By uniformly, we mean each key is equally likely to be chosen. Suppose this is not the case. Recall that cryptosystem is being used to encrypt fourdigit PINs. Suppose the PINs themselves are chosen uniformly at random, but the interceptor knows that certain keys are more likely to be chosen than others. In that case, the best strategy for the interceptor is to guess one of these more likely keys. Since this strategy will have a greater probability of success than guessing the plaintext, although the cryptosystem may still be pretty good, it will not offer perfect secrecy.

A key should only be used once: This property is why a onetime pad is called ‘onetime.’ This doesn’t mean that after a key has been used, this key must never be used again. What it means is that each time a onetime pad is used, the current key should be discarded, and a new key should be selected uniformly at random from the keyspace. If by chance, the same key is selected on two different occasions, then that’s fine, since an attacker cannot predict when this might happen.
Note: These three properties alone don’t make onetime pads the preferred choice for everyone since there are cryptosystems that have these properties but do not have perfect secrecy. The property we normally aspire to have in a onetime pad is perfect secrecy. However, if a cryptosystem is a onetime pad, then it must have these three properties.
Get handson with 1200+ tech skills courses.