An interactive cryptanalysis workbench that runs entirely in your browser.
Encrypt, decrypt, and break classical ciphers — from Caesar to DES and RSA — with live frequency analysis, automatic cipher detection, and a quadgram-scoring solver that cracks monoalphabetic substitution ciphers with no key at all. Every byte is processed on your own device; nothing is ever uploaded.
Decipher grew out of the CS641 cryptography assignments — a series of hand-and-Python cipher breaks. The original solvers still live under
legacy/; this project reimplements them in TypeScript and wires them into a single interactive tool.
- Automatic detection — index of coincidence, χ² and entropy fingerprint the ciphertext and rank the most likely schemes.
- Keyless solvers — brute-force Caesar and Affine, IoC-driven Vigenère key recovery, and a quadgram hill-climb that reads plain substitution ciphers with no key.
- Real block & public-key crypto — a from-scratch DES (ECB/CBC) over the FIPS bit tables, and educational RSA attacks (modulus factoring and the low-exponent e-th root) over native
BigInt. - Private by construction — the heavy hill-climb runs off the main thread in a Web Worker. No servers, no logging, no network round-trips for your plaintext.
Nine ciphers ship in the workbench: Caesar & Atbash, Affine, Vigenère, Monoalphabetic Substitution, Rail Fence, Playfair, XOR, DES, and RSA.
- Next.js 15 (App Router) + React 19
- Tailwind CSS v4
- TypeScript, Web Workers, native
BigInt - A quantized quadgram corpus served as a cached binary (
public/quadgrams.bin)
npm install
npm run devOpen http://localhost:3000.
To rebuild the quadgram model from a corpus:
npm run quadgramsnpm run build
npm run startThe app is a standard Next.js project and deploys to Vercel with zero configuration:
- Push this repository to GitHub.
- Import it at vercel.com/new — the framework is detected automatically.
- Deploy. No environment variables are required.
Optionally set NEXT_PUBLIC_SITE_URL to your production domain so Open Graph / canonical URLs resolve correctly.
The image uses Next.js standalone output for a small final layer.
# Build and run directly
docker build -t decipher .
docker run -p 3000:3000 decipher
# …or with Docker Compose
docker compose up --buildThen open http://localhost:3000.
app/ Next.js routes (landing page, workbench, about)
components/ Shared UI (stats panel)
lib/
ciphers/ Cipher implementations and attacks
analysis.ts Text statistics + heuristic classifier
quadgrams.ts Quadgram scorer and binary loader
run.ts Uniform encrypt/decrypt/break dispatch
solver.worker.ts Substitution hill-climb (Web Worker)
public/ quadgrams.bin
legacy/ The original CS641 Python solvers
scripts/ Quadgram corpus builder
MIT — see LICENSE.