b2KIT

One-Time Pad Generator

Generate cryptographically random one-time pads and encrypt/decrypt messages with perfect secrecy (educational).

Tested tool guide Tested browser tools Checked August 16, 2026

What One-Time Pad Generator does and how it behaves

The one-time pad is the rare cipher that carries a proof of unbreakability, and this page lets you watch that proof in action: it generates fresh random key material in the browser and combines it with your text to produce ciphertext, or reverses the process when you supply the pad. All of it runs locally, so nothing you type is uploaded. The part users most often get wrong is key handling, not the math: a pad reused for a second message stops being secret, and the pad must reach the recipient through a channel separate from the ciphertext.

How the result is produced

1

How the pad is applied

Standard one-time pads operate on bits or bytes: the pad is a string of random bytes exactly as long as the message, each message byte is XORed with the pad byte at the same position, and decryption applies the same XOR again. The character-based pad this page works with is a pedagogical presentation of the same construction, combining each letter's numeric value with the matching pad value and wrapping around the alphabet's size. No position depends on any other, so one wrong or missing pad value corrupts exactly that one position and nothing else.

2

Why 'one-time' is the whole rule

The proof of perfect secrecy assumes a fresh, uniformly random pad for every message. If the same pad encrypts two messages, an attacker who has both ciphertexts can subtract one from the other and the pad cancels out, leaving a combination of the two plaintexts, which are often recoverable from word patterns and redundancy alone. The tool cannot detect reuse; that discipline is the operator's job.

Good uses

  • In a classroom or study group, demonstrating why a truly random key as long as the message defeats every attack, including brute force.
  • Sending a short message to someone who can receive the pad out of band, such as a printed page or USB stick, while the ciphertext itself travels over email or chat.
  • Double-checking a one-time pad you worked out by hand: encrypt or decrypt the same text here and compare the results before relying on it.

Limits and checks

  • Out-of-band rule: if the pad travels over the same email, chat, or network as the ciphertext, anyone reading that channel has the whole secret, and the encryption adds nothing.
  • No recovery: a ciphertext without its pad is unrecoverable by design. Losing the pad is not a fixable problem, there is no password reset, so treat the pad itself as the secret document.
  • The proof assumes genuine randomness: the perfect-secrecy guarantee holds only for uniformly random pads. A pad you typed yourself, or one from a toy generator, does not qualify, and conventions such as A=0 or A=1 mapping can differ between tools, so ciphertext may not decrypt cleanly elsewhere.

Common questions

Can I reuse the same pad for another message?

No. Two ciphertexts made with the same pad let anyone who sees both subtract one from the other, canceling the pad and leaving a combination of the two messages, from which both can often be reconstructed. The one-time pad is only 'one-time': every new message needs a fresh pad at least as long as itself.

Should I use this for real secrets?

Only if you fully manage the hard parts: the pad must come from genuinely random generation, reach the recipient by a channel the adversary cannot read, and never be reused. Browser tools like this one are built for learning; for real-world encryption, use vetted software such as OpenPGP or SSH, which handle key management for you.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools