Why a one-time pad can be mathematically unbreakable

A one-time pad encrypts a message by combining each part of the message with a corresponding part of a secret key. In a simple binary version, each bit of the message is flipped or left alone according to the matching key bit. Decryption repeats the operation with the same key, restoring the original message.

The crucial condition is that the key must be truly random, as long as the message, kept secret, and used only once. With those conditions met, every possible message of that length is compatible with the encrypted result. An interceptor cannot use patterns in the ciphertext to identify which message was sent; the ciphertext alone gives no preference to one candidate over another. That is what “unbreakable” means here—not that the message is impossible to decrypt, but that the ciphertext provides no information to an outsider about its contents.

The key becomes the hard part

The security depends on both people already possessing identical copies of the key. They need a way to deliver it that is at least as secure as the message they hope to protect. For a long message, that means securely distributing a long string of random material before communication begins. If the key is copied, intercepted, or guessed, the protection fails.

Reusing the pad is especially dangerous. Once the same key encrypts two messages, their ciphertexts share a relationship created by that repeated key. Attackers can exploit that relationship to learn about the messages, particularly when they can guess some of their contents. The rule “one time” is therefore part of the mathematics, not a recommendation for better housekeeping.

Security traded for logistics

A one-time pad shifts the problem rather than eliminating it: instead of finding a way to crack the code, someone must protect and distribute enough secret key material. That makes it impractical for most everyday communication, where messages are frequent and the participants may never meet. Its enduring lesson is that perfect secrecy is possible in principle—but only when the secret needed to protect a message is itself just as carefully managed.