The ASCII shift cipher is the byte-level generalisation of the classic Caesar cipher. Instead of rotating only the 26 letters of the alphabet, it adds a constant N to the numeric value of every byte, wrapping around modulo 256. That means it works on letters, digits, punctuation, whitespace and even the individual bytes of multi-byte UTF-8 characters.
How it works
The text is first encoded to UTF-8 bytes. Each byte b is then transformed:
encrypt: b' = (b + N) mod 256
decrypt: b' = (b - N) mod 256
Because the byte range is 0–255, adding N can push a value past 255, in which case it wraps around — 250 + 10 becomes 4. Decryption subtracts the same N and the modular wrap exactly undoes the encryption, recovering every original byte.
Since a shifted byte frequently is not a printable character (or not a valid start of a UTF-8 sequence), the tool shows the result as hex bytes by default, and additionally as text whenever the shifted bytes happen to form valid UTF-8.
Example
Shifting Gera Tools by N = 13 gives the bytes:
54 72 7f 6e 2d 61 7c 7c 79 80
Notice that space (0x20) became 0x2d (a hyphen) and the final s (0x73) wrapped to 0x80, which is not printable on its own. Decrypting these bytes with N = 13 subtracts 13 from each and returns Gera Tools.
How this differs from a Caesar cipher
A traditional Caesar cipher:
- Operates only on the 26 letters A–Z (and sometimes a–z).
- Leaves digits, punctuation, and spaces unchanged.
- Wraps at 26 (the alphabet size).
The ASCII byte shift:
- Operates on every byte in the UTF-8 encoding of the text.
- Letters, digits, punctuation, whitespace, and control characters are all shifted.
- Wraps at 256 (the byte range).
The consequence is that an ASCII shift with N = 13 on a purely alphabetic string is not the same as ROT13 — ROT13 keeps non-letter characters in place, while a byte shift also moves them. On strings containing only uppercase letters, though, a byte shift of 13 and a Caesar shift of 13 both shift those letters by the same amount.
Practical uses
- Encoding puzzles and educational exercises. The cipher is easy to explain, illustrate, and manually verify, making it useful in cryptography education.
- Obfuscating human-readable text in config files. A byte shift makes a value not immediately readable at a glance without offering any real security. Use it only for low-stakes obfuscation where the goal is not to prevent a determined reader.
- Exploring byte-level encoding. Seeing which bytes produce printable output after shifting gives hands-on intuition for how character encodings work.
Security note
There are only 256 possible shifts (N = 0 through 255), so brute-force decryption takes at most 256 attempts — effectively instant for any software. The cipher also preserves the statistical byte distribution of the original text, which makes frequency analysis straightforward. Do not use this for any real data protection. For that, use a modern authenticated encryption scheme.
Notes
- Any whole number works as the shift; it is reduced modulo 256, so a shift of 256 is the same as 0 and 269 is the same as 13.
- Paste hex back into the tool in decrypt mode to recover the original text exactly, even when the encrypted bytes were not printable.
- This is an obfuscation and learning tool, not encryption. All processing runs locally in your browser.