Vernam Cipher (One-Time Pad)
XORs your text byte by byte against a key and prints the ciphertext in hex. A short key repeats, so it is a true one-time pad only if it matches the length.
Hex
—
Repeating-key XOR is not a one-time pad
The claim that a one-time pad is mathematically unbreakable is true, which is exactly why it misleads people. It holds only under three simultaneous conditions: the key must be genuinely random, as long as the message in bytes, and used exactly once. Break any one of them and you are left with an ordinary XOR cipher, the kind that falls to position-wise frequency analysis.
This tool encodes both text and key as UTF-8 bytes, XORs them byte by byte, and prints the result in hex. HELLO under the key XMCKL gives 10080f0703: five bytes of plaintext against five of key, a legitimate pad. If the key is shorter than the text it is repeated cyclically with no warning, and at that moment it stops being Vernam. Length is counted in bytes, not characters: coracao with a cedilla and a tilde takes eight UTF-8 bytes, not seven.
For an honest demonstration, generate random bytes matching the byte length of your text and never reuse that key on a second message. This page only encrypts: there is no hex-to-text direction here, though since XOR is symmetric any hex XOR tool with the same key recovers the original. Everything runs in the browser with no network request. Treat it as a learning aid: distributing and destroying pads is the problem that keeps the one-time pad impractical outside textbooks.
Frequently asked questions
How do I decrypt the hex back to text?
Why is the output hexadecimal?
Can the key be shorter than the message?
Related Tools
Encrypt Text
Apply classic ciphers (Caesar, ROT13, Atbash) or Base64. Useful for puzzles, CTFs and testing — do not use for real security.
Vigenère Autokey Cipher Encoder and Decoder
Enciphers or deciphers text with the classic autokey variant, where the plaintext extends the keyword instead of repeating it. Letters A to Z only.
Columnar Transposition Cipher
Encrypts or decrypts text by writing it in rows under a keyword and reading the columns in alphabetical key order, padding the last row with X.
A1Z26 Cipher
Converts text into numbers by each letter position in the alphabet (A=1, Z=26), separated by hyphens. A simple cipher popular in geocaching, escape rooms and logic puzzles.
Bacon Cipher
Encodes text with the Bacon cipher, replacing each letter with a group of five As and Bs. Uses the modern 26-letter alphabet, keeping I and J apart.
ROT13 Cipher
Apply the ROT13 cipher (rotate by 13 letters) to text. Applying twice returns the original. Used in forums to hide spoilers. Only A–Z and a–z are affected. Everything in your browser.