Caesar Cipher: An Interactive Encoder/Decoder

2026-05-19

The Caesar cipher is one of the simplest and oldest known encryption techniques. Named after Julius Caesar, who reportedly used it to protect military correspondence, the method shifts each letter in the alphabet by a fixed number of positions. A shift of +3 turns A into D, B into E, and wraps Z around to C.

It’s trivially breakable by modern standards — there are only 25 possible shifts to try — but it remains a perfect entry point into the mechanics of substitution ciphers and the logic of cryptanalysis.

The Game

This interactive app lets you practice both sides of the cipher:

Hints reveal individual letters in the puzzle grid (shown in orange so everyone knows), and a running timer keeps the pressure on.

▸ Launch Caesar Cipher

How the Shift Works

Encryption with a shift of +3:

Plain A B C D E X Y Z
Cipher D E F G H A B C

Decryption is the reverse — subtract the shift. A cipher letter H with shift +3 maps back to E. The math is modular arithmetic over 26 characters:

E(x) = (x + k) mod  26

D(x) = (x − k) mod  26

where x is the letter’s position (A=0, B=1, …, Z=25) and k is the shift key.

Scoring

Solo mode scores on a point system that rewards speed and penalizes crutches:

Difficulty Base Points
Recruit 100
Agent 250
Commander 500

Deductions: 0.5 points per second elapsed (capped at half the base), 25 points per extra attempt beyond the first, and 40 points per hint used. Grades run from S (80%+ of base) down to D.

Source

Built with React and Tone.js for synthesized sound effects. The entire app runs client-side — no backend, no data collection. Shareable links encode the puzzle into the URL hash using base64.