QiLing Tools

🔑Cipher Decoder - Caesar, Vigenère Cracker & Enigma Simulator

A classical cryptography lab that runs in your browser — handy for learning, CTF puzzles and classroom demos. Caesar / ROT-N lets you drag the shift, and when decrypting it lists all 26 shifts ranked by chi-squared distance to English letter frequencies, so the most English-looking result is on top. Vigenère works with a key, or without one: the auto-cracker runs the Kasiski examination to list repeated fragments and their distances, computes the average index of coincidence for each candidate key length (English is about 0.066), and then solves each column by frequency analysis to recover the key and the plaintext — click a bar in the chart to force a different length. Simple substitution comes with a letter-frequency chart against English and a letter-by-letter mapping table that shows the partial decryption live as you type your guesses. The Enigma I simulator has rotors I–V, reflectors B and C, ring settings, start positions and a plugboard, implements the middle-rotor double step correctly and shows the signal path of the last letter; it matches published test vectors (AAAAA at AAA gives BDZGO, and the 1941 Operation Barbarossa message). Atbash, affine, Beaufort, Playfair (with its 5×5 square), rail fence (with the zigzag layout), columnar transposition, Bacon and the Polybius square are included too. You can keep case and punctuation; only English letters are transformed, so Chinese and other text stays untouched.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Classical Cipher Lab

  1. 1Choose a cipher and set the key, shift or rotor settings
  2. 2Type plaintext or ciphertext on the left and read the result on the right as you type
  3. 3No key? Use the Caesar brute force, the Vigenère auto-cracker or frequency analysis for substitution ciphers

FAQ

How is a Vigenère cipher cracked?
The trick is to find the key length first. The Kasiski examination looks for fragments that repeat in the ciphertext — their distances tend to be multiples of the key length. The index of coincidence splits the ciphertext into columns for each candidate length: with the right length every column is a plain Caesar cipher whose letters follow English frequencies, giving an average IC near 0.066, while a wrong length looks random at about 0.038. Then each column is tried with all 26 shifts, and the one closest to English (lowest chi-squared) gives one letter of the key.
Why does the auto-crack fail on short ciphertexts?
Frequency analysis relies on statistics: each column needs at least a few dozen letters before its letter counts resemble English. The longer the key and the shorter the message, the fewer letters per column, and both the length estimate and the shifts can go wrong. Aim for 200+ letters; if the result looks wrong, click another length in the index-of-coincidence chart or look for common factors among the Kasiski distances.
Why are Enigma encryption and decryption the same operation?
The reflector sends the current back through the rotors along a different wire, so at every rotor position the whole machine is a set of letter swaps: if A encrypts to G, then G encrypts to A at that same position. The receiver only has to set up the same rotors, rings, start positions and plugboard and type the ciphertext to get the plaintext back. It also caused a famous weakness — no letter can ever encrypt to itself.
Can I encrypt Chinese or other non-English text?
These classical ciphers were designed for the 26-letter Latin alphabet, so the tool only transforms the letters A–Z; Chinese characters, digits and punctuation are kept as they are by default (or dropped if you choose). You could romanise text first, but for anything that needs real security use a modern algorithm such as AES — classical ciphers are for learning and fun.