How it works
This Vernam cipher decoder pairs every character of your code with one character of a key just as long. It works by letter values from A = 0 to Z = 25 or by XOR on five-bit tape codes, every step shown.
Read the full guide
Subtract the key, letter by letter
Letter shift subtracts key from code. EQNVZ under XMCKL reads hello: E is 4, X is 23, and 4 minus 23 plus 26 is 7, H. Under XOR on five bits the same key applied twice returns the message. A Key shorter than the message is refused.
Five impulses, 32 codes
Gilbert Vernam's 1919 patent, as Wikipedia gives it, has A as ++---, the key B as +--++ and the result -+-++, G. The table here is ITA2, the 1932 standard that example agrees with. Six of the 32 codes are not letters and take Bletchley Park's names: / for null, 9 for space, then 3, 4, 5 and 8. A / in the output means message and key matched.
Tips
- Any reading fits some key. With KTCDOWLJJGZWYQWM as Key, the opening code reads no biscuits please, not send more biscuits.
- No 8-bit ASCII here. XOR on five bits takes letters, / 9 3 4 5 8, or groups like 11000.
Questions and answers
Is a Vernam cipher the same as a one-time pad?
Only under four conditions: the key is at least as long as the message, truly random, never reused and kept completely secret. Under Encode, New random key draws on your browser's generator, an algorithm, so it makes a stream cipher. Keep this page for puzzles.
Why can a key never be used twice?
Because the key cancels. XOR two codes from one key and both messages remain, XORed together. Codebreakers call that a depth. Set Mode to XOR on five bits. Paste QRCCSFMKH4TTETJPRK as code and QRCCSFMKH4BQUGK48L as Key. Ten / marks come first: both messages start send more.
What is the difference between a Vernam and a Vigenère cipher?
Key length. A Vigenère key is a short word that starts again, and Kasiski published a general attack on that repetition in 1863. A Vernam key runs the whole message and is never reused. Under More options, Repeat a short key decodes a Vigenère.