cryptography

Definition

One-Time-Pad

The One-Time-Pad is a symmetric encryption scheme that provides perfect secrecy.

Plaintexts, ciphertexts, and keys are bitstrings of equal length; the key is randomly generated and used exactly once. Encryption and decryption are performed via bitwise XOR:

Correctness

Perfect Secrecy

The proof relies on the fact that for any observed ciphertext , every plaintext is equally likely: there exists exactly one key that produces from , and since is uniformly distributed and independent of , this holds with probability .

Problems

Key Requirements

  • True randomness of the key is difficult to achieve
  • Key storage requires as much space as the ciphertext itself
  • Key must be communicated securely to the receiver and used only once

Key Reuse

If two messages and are encrypted with the same key , then . If both plaintexts are in a natural language, they can typically be recovered using heuristics. If one plaintext is known to the attacker, the other is easily computed: .

No Integrity

Changes to the ciphertext are directly reflected in the plaintext. An attacker who knows part of the plaintext can flip the corresponding bits in the ciphertext to produce a targeted modification.