nrtechstudioCLASSICAL CIPHER LAB 🔒 100% client-side — no data ever leaves your browser

Classical Cipher Lab

Encode, decode and break history's most famous ciphers — ROT13/5/47, Caesar with a 26-shift brute-force solver, and Vigenère with real cryptanalysis (key-length estimation + chi-square key recovery). A hands-on lab for CTF players, puzzle hunters, students and the curious. Use it as a caesar cipher decoder and encoder, a rot13 decoder, encoder and translator, or a vigenere cipher decoder that recovers a lost key for you.

📜 ROT13 · ROT5 · ROT47 · ROT18 · Atbash ⚔️ Caesar solver — all 26 shifts 🗝️ Vigenère key recovery, no key needed ▦ Interactive tabula recta

Honest disclaimer: classical ciphers are not secure encryption — they are broken by hand or in seconds by software. This lab is for learning, puzzles and CTF competitions. For real encryption, use modern AES-256.

I. ROT Encoder–Decoder

Your rot13 decoder, rot13 encoder and rot13 translator in one place: ROT13, ROT5, ROT47, ROT18 and Atbash. ROT13/5/47 are their own inverse — encoding twice returns the original text.

Output appears here…
0
input chars
0
output chars
0
chars changed

ROT13 rotates letters (A→N); ROT5 rotates digits (0→5); ROT18 = ROT13+ROT5; ROT47 rotates all 94 printable ASCII characters; Atbash mirrors the alphabet (A→Z).

II. Caesar Cipher Encoder & Decoder

A caesar cipher encoder, caesar cipher decoder and caesar cipher translator in one: encode caesar cipher text or decode it by shifting every letter N positions (Julius Caesar used 3). Case and punctuation are preserved.

Shift (1–25) 3
Result appears here…

Encoding with shift N is identical to decoding with shift 26−N. Try shift 13 — that is ROT13.

III. Caesar Brute-Force Solver

The caesar cipher solver: don't know the shift? Try all 26. Each candidate is scored with a chi-square test against English letter frequencies — the lowest score is almost always the correct plaintext.

Click any row to load it as the decoder input. χ² (chi-square) near the English baseline (~30–60 for long text) = likely English.

Letter frequency analysis

Why the solver works: English letters are not equally common. Compare the input's distribution with expected English.

IV. Vigenère Encoder & Decoder

A vigenere cipher encoder and decoder: encrypt with a repeating keyword. Non-letters pass through unchanged; the key advances only over letters.

Result appears here…

Classic example: ATTACKATDAWN + key LEMON → LXFOPVEFRNHR.

V. Vigenère Cryptanalysis — break it without the key

The moat of this lab: a real two-stage cryptanalysis pipeline. Stage 1 estimates the key length (Friedman's index-of-coincidence test + column-IC ranking). Stage 2 recovers the key with a chi-square attack on each column — a complete pipeline to break vigenere cipher without the key. Works best on 200+ letters of English text.

VI. Interactive Tabula Recta

The Vigenère square (also called the vigenere square): 26 rows × 26 columns. Find the plaintext letter down the first column, move across to the key letter's column — the intersection is the cipher letter. Click any cell or type a pair below.

Row A + Column L → cipher letter L

Trace the classic: plaintext A with key L gives L; T with key E gives X; T with key M gives F — the first three letters of LXFOPVEFRNHR.

VII. A short history of secret writing

  • ~600 BC
    Atbash — Hebrew scribes mirror the alphabet (A↔Z). One of the oldest known ciphers, appearing in the Book of Jeremiah.
  • ~50 BC
    Caesar cipher — Julius Caesar shifts the alphabet by 3 for military orders, according to Suetonius. Augustus later used a shift of 1.
  • 1553 / 1586
    Vigenère — Giovanni Battista Bellaso describes the polyalphabetic method; Blaise de Vigenère publishes it in his Traicté des Chiffres. Dubbed le chiffre indéchiffrable.
  • 1863
    Kasiski breaks Vigenère — Prussian officer Friedrich Kasiski publishes the first general attack (Babbage had found it privately in 1854).
  • 1920s
    Friedman formalizes it — William F. Friedman, father of American cryptanalysis, introduces the index of coincidence for key-length estimation.
  • 1980s
    ROT13 — Usenet culture adopts the 13-shift to hide spoilers and punchlines; it survives today in puzzles and CTF warm-ups.

VIII. Worked examples

Caesar cipher shift 3 — “HELLO” → “KHOOR”

Each letter moves 3 forward, wrapping past Z:
H → K   E → H   L → O   L → O   O → R
Decoding moves them 3 back: KHOOR → HELLO.

ROT13 is its own inverse

GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT
ROT13 again → THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. Apply twice, get the original back — always.

Vigenère — ATTACKATDAWN with key LEMON

The key repeats under the plaintext; each pair is added (A=0…Z=25):
A+L(11) = L   T+E(4) = X   T+M(12) = F   A+O(14) = O   C+L = N …
Full result: LXFOPVEFRNHR. Notice the two A's in ATTACK became L and O — that is the whole point.

Breaking Caesar without the key

Mystery text: Aol aylhzbyl pz ibyplk bukly aol vsk vhr ayll ha tpkupnoa
Run the brute-force solver: 25 wrong shifts score high on the chi-square test, shift 7 scores lowest → The treasure is buried under the old oak tree at midnight.

IX. Where these ciphers are used

CTF (capture-the-flag) competitions · puzzle hunts · geocaching clues · escape rooms · cryptography courses · spoiler-hiding in forums. If you are training for CTFs, the Vigenère breaker above is the same pipeline (IC + chi-square) that solves real warm-up challenges.

Need real encryption?

Classical ciphers protect nothing. For actual secrets use AES-256 encryption (modern, authenticated) — or identify a hash if you are analyzing one.

X. Frequently asked questions

What is a Caesar cipher?
A Caesar cipher shifts every letter of the alphabet by a fixed number of positions. With a shift of 3, A becomes D, B becomes E, and HELLO becomes KHOOR. Julius Caesar reportedly used it around 50 BC for military messages. It is a substitution cipher with only 25 possible shifts, which is why any computer — or patient human — can break it in seconds.
How do I decode a Caesar cipher without knowing the shift?
Try all 25 possible shifts and pick the one that looks like English — that is the brute-force method, and it always works because there are so few candidates. This lab automates it: the Caesar solver shows all 26 candidates and scores each with a chi-square test against English letter frequencies, highlighting the best guess automatically. It is the definitive answer to 'decode caesar cipher without key' and 'caesar cipher all shifts' queries.
What is ROT13 and how does it work?
ROT13 rotates each letter 13 places through the alphabet (A becomes N, N becomes A). Because 13 is exactly half of 26, applying ROT13 twice returns the original text — the same function encodes and decodes. It was popular on 1980s Usenet to hide spoilers and punchlines. ROT5 is the same idea applied to digits (0 becomes 5), ROT47 rotates 94 printable ASCII characters, and ROT18 combines ROT13 with ROT5.
What is the difference between ROT13, ROT47 and ROT18?
ROT13 rotates letters only, ROT5 rotates digits only, and ROT18 applies both at once (ROT13 on letters plus ROT5 on digits), so it is a full encoder for typical text with numbers. ROT47 is a superset that rotates all 94 printable ASCII characters (letters, digits and punctuation) by 47 positions — also its own inverse. Use ROT47 when punctuation must be scrambled too, and ROT18 when only letters and digits matter.
What is the Vigenère cipher?
The Vigenère cipher encrypts with a repeating keyword instead of a single shift: each plaintext letter is shifted by the corresponding key letter (A=0, B=1, ...). ATTACKATDAWN with the key LEMON becomes LXFOPVEFRNHR — the two As in ATTACK encrypt to different letters because the key advances. Published by Blaise de Vigenère in 1586, it resisted breaking for nearly 300 years and was called 'le chiffre indéchiffrable' (the indecipherable cipher).
How do you break a Vigenère cipher without the key?
In two steps. First, estimate the key length: the index of coincidence (Friedman's test) measures how 'English-like' the letter distribution is, and splitting the ciphertext into columns at the correct key length makes each column look like a simple Caesar cipher (index of coincidence near 0.065). Second, run a chi-square frequency analysis on each column to recover each key letter. This lab performs both steps automatically — paste ciphertext, click 'Break it', and you get candidate key lengths, the recovered key, and the decoded text.
How is Vigenère key length estimated?
Two classic methods are used here. Friedman's formula estimates the key length directly from the index of coincidence of the ciphertext. The more robust method tries candidate lengths 1–20, splits the ciphertext into that many columns, and measures the average index of coincidence per column: the correct length (and its multiples) scores near 0.065, the English value, while wrong lengths stay near 0.038. The lab ranks all candidates and recommends the smallest fundamental length.
What is the tabula recta (Vigenère square)?
The tabula recta is a 26×26 grid where each row is the alphabet shifted by one more position — row A is ABC..., row B is BCD..., and so on. To encrypt, you find the plaintext letter down the first column, move across to the key letter's column, and read the cipher letter at the intersection. The interactive tabula recta in this lab lets you click or type any row/column pair to see the exact cell, which is how Vigenère encryption was done by hand for centuries.
Why is frequency analysis used to crack ciphers?
In English, letters are not equally common: E appears about 12.7% of the time while Z appears about 0.07%. A monoalphabetic substitution like Caesar preserves these frequencies, just relabeled. The chi-square statistic measures how far a text's letter distribution is from expected English; the correct shift minimizes it. That is why the Caesar solver can pick the right shift automatically, and why the same test recovers each letter of a Vigenère key once the columns are split.
Are Caesar, ROT13 and Vigenère ciphers secure?
No — none of them are secure by any modern standard, and none should protect real data. Caesar has only 25 possible keys, ROT13 is not even a cipher with a key, and Vigenère falls to 19th-century cryptanalysis (Kasiski and Friedman) given enough ciphertext. They are excellent for learning, puzzles, CTF competitions, escape rooms and geocaching — for actual encryption, use a modern tool like the AES-256 encryptor linked below.
What is the difference between a cipher and an encoding like Base64?
A cipher transforms a message with a secret key so it cannot be read without it (classical ciphers do this weakly, AES does it strongly). An encoding like Base64 merely represents the same data in a different alphabet — there is no key, and anyone can reverse it instantly. ROT13 sits in between: it looks like a cipher but has no key, so treat it as obfuscation, not encryption.
Where are classical ciphers actually used today?
Mainly in puzzles and education: CTF (capture-the-flag) cybersecurity competitions, puzzle hunts, geocaching clues, escape rooms, and cryptography courses, where ROT13, Caesar and Vigenère are standard warm-up challenges. Historically, Caesar protected Roman military orders and Vigenère protected diplomatic correspondence for centuries. ROT13 still appears in forums and puzzle communities to hide spoilers.
How do I encode text with a Caesar shift of 3 (or any shift)?
Pick the shift, then move every letter forward that many places, wrapping from Z back to A; decoding moves them backward. With shift 3, HELLO becomes KHOOR. This lab's Caesar tab has a shift slider (1–25) that encodes and decodes live, preserves uppercase/lowercase and punctuation, and includes worked examples for shifts 3, 7 and 13.
What is the Atbash cipher?
Atbash is an ancient Hebrew substitution cipher that mirrors the alphabet: A becomes Z, B becomes Y, C becomes X, and so on. It appears in the Book of Jeremiah and is one of the oldest known ciphers. Like ROT13, it is its own inverse. The ROT lab here includes an Atbash mode alongside ROT13/5/47/18.
Can the Vigenère breaker recover the key from short ciphertext?
It depends on length. Key-length estimation and chi-square key recovery are statistical methods — they work reliably on a few hundred letters of English text, but short or non-English text can mislead them (a column of 20 letters is often too thin for frequency analysis). The lab shows confidence indicators and the full candidate ranking so you can judge, and you can always override the guessed key manually.
Is my text sent to a server?
No. This lab runs 100% in your browser — every encode, decode, brute-force and cryptanalysis step is computed locally with JavaScript, and there are no network requests at all. You can even disconnect from the internet and keep using it. Your text never leaves your device.

Free tool by NRTechStudio