How to use it
- Choose letters (classic pad) or bytes, and the direction.
- In letter mode choose the alphabet; the example message for it appears.
- Type the message and press New random key: it creates exactly as many key characters as the message needs.
- Copy the result and the key. To decrypt, press the button under the result or switch the direction and paste the ciphertext with the same key.
How it works
- Letters: the alphabet letters are numbered from 0 (A = 0 … Z = 25 for Latin). Encrypting: C = (P + K) mod n; decrypting: P = (C − K) mod n, where n is 26, 33 or 27. Lower case is turned into capitals and accents are dropped (Á → A), except for letters of the alphabet itself such as Ñ or Ё.
- Bytes: the message is UTF-8, each byte is XORed with a key byte, the ciphertext is hex. Decryption XORs again and reads the bytes as UTF-8.
- The key must be at least as long as the message; it is used from its first character.
Example
The textbook example HELLO with the key XMCKL:
| H | E | L | L | O | |
|---|---|---|---|---|---|
| Message | 7 | 4 | 11 | 11 | 14 |
| Key | X 23 | M 12 | C 2 | K 10 | L 11 |
| Sum mod 26 | 30 → 4 | 16 | 13 | 21 | 25 |
| Ciphertext | E | Q | N | V | Z |
The result is EQNVZ, using 5 key characters. Decrypting EQNVZ with XMCKL gives HELLO again: E 4 − X 23 = −19 → 7 = H, and so on.
Tips
- Store the key separately from the ciphertext; whoever has both can read the message.
- Destroy a key once it has been used: re-using it is what broke real one-time pad systems.
- For bytes mode, both sides need the same hex key; copy it as text, not as a screenshot.