Skip to content
Also from us: TypologyOnline.com · Free personality tests

One-Time Pad / Vernam Cipher

Encrypt or decrypt letters with an equal-length key, securely generate a random pad in your browser, and inspect every modulo-26 step.

Key and formatting Show options

One-time key

How the key works: Each A–Z letter in your message uses one A–Z key letter. Spaces, punctuation and numbers do not use key letters.

Message
HELLO
Key
XMCKL
Result
EQNVZ

Enter your own key for demonstrations, or generate a random key for a genuine one-time pad. A secure key must remain secret and never be reused.

Enter a message, then generate or supply a one-time key.

Formatting options

5

Input text

Output text

Calculation steps

Enter text and supply a key of equal letter length to see the modular arithmetic behind each character.

Cipher properties

Type Polyalphabetic Arithmetic Modulo 26 Key length Message length Secure only if Random and never reused Active mode Encrypt
Important: this browser tool demonstrates an alphabetic one-time pad. Perfect secrecy applies only when the key is uniformly random, at least as long as the plaintext, shared securely, kept secret and used exactly once.

Using This Tool: Guide & Notes Show guide

The one-time pad combines each message letter with one key letter using modulo-26 arithmetic. This tool demonstrates the alphabetic method, validates the pad length, and can generate a cryptographically random key locally in your browser.

How to use it

  • Choose Encrypt for plaintext or Decrypt for ciphertext, then enter the message in the input box.
  • Enter a pad containing at least one A–Z letter for every message letter, or use Generate secure key to create the required number of random letters in your browser.
  • Read the output and inspect Calculation steps to see the value, key letter, modular equation, and result for each supported character.
  • Use Swap input/output to reverse the current result with the same pad, or copy the input and output when you need them elsewhere.

Options and settings

  • Preserve case keeps the visible uppercase or lowercase style of each transformed input letter.
  • Keep punctuation and numbers carries non-letter characters through without consuming key letters.
  • Remove whitespace creates compact output while leaving the underlying letter calculations unchanged.
  • Group letters produces uppercase A–Z blocks and removes punctuation, numbers, and whitespace; the stepper sets groups from 2 to 12 letters.
  • Trim to length removes unused key letters. Extra key letters are ignored, but a short key prevents output.

Notes

  • Perfect secrecy requires a uniformly random key at least as long as the plaintext, delivered securely, kept secret, and used for exactly one message.
  • Reusing any part of a one-time pad can expose relationships between messages and destroy its defining security guarantee.
  • This is an alphabetic modulo-26 teaching model. Historical Vernam systems and modern digital data are often described with binary XOR instead.
  • The key is generated and processed locally. The tool does not store, transmit, or recover lost pads.
Related Article

One-Time Pad: The Cipher That Cannot Be Broken

How a random key as long as the message turned simple addition into cryptography’s rarest promise—perfect secrecy—and why one reused page can bring the whole system crashing down.

Read the article
Signal acquired

A note from the team

We build these tools because we love cryptography, encoding, and making difficult ideas easier to explore. If they've helped you, even a small coffee means the world to the project. Thank you!

Say thanks on Ko-fi