classical-cipher-analysis

Identifies and breaks classical ciphers using frequency analysis, Kasiski examination, and brute-force attacks.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/lNwNl/Praxis --skill classical-cipher-analysis-lnwnl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: classical-cipher-analysis
Source: https://github.com/lNwNl/Praxis/tree/main/skills/classical-cipher-analysis
Command: npx skills add https://github.com/lNwNl/Praxis --skill classical-cipher-analysis-lnwnl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, sympy.

What problem does it solve? CTF challenges often present ciphertext without identifying the cipher type, and jumping to the wrong attack wastes time. This Skill provides a systematic identification methodology (character set analysis, Index of Coincidence, Kasiski examination) followed by concrete attack implementations for each classical cipher family. ## Core Features & Use Cases - Cipher Identification Pipeline: Character set analysis, frequency analysis, IC computation, and Kasiski examination to distinguish monoalphabetic, polyalphabetic, transposition, and encoded ciphertext before attacking. - Attack Implementations: Ready-to-use Python code for Caesar/ROT brute force with chi-squared scoring, Vigenere key-length detection and per-column cracking, affine cipher brute force, Hill cipher known-plaintext attack, rail fence and columnar transposition, XOR analysis, and Bacon/Polybius/Playfair decoding. - Use Case: Given an uppercase ciphertext in a crypto challenge, compute its IC to confirm monoalphabetic substitution, run frequency analysis to build an initial mapping, then refine with crib dragging using the known "flag{" prefix. ## Quick Start Analyze this ciphertext from my CTF challenge, identify the cipher type using frequency analysis and IC, then decrypt it.

Frequently Asked Questions about classical-cipher-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify an unknown cipher in a CTF challenge?▼

Start with character set analysis to detect encodings like Base64, hex, or Morse, then compute the Index of Coincidence on letter-only text. IC near 0.065 indicates monoalphabetic substitution, IC around 0.04-0.05 suggests polyalphabetic ciphers like Vigenere, and IC near 0.038 implies a long key or one-time pad.

How to crack a Vigenere cipher without knowing the key?▼

First find the key length using Kasiski examination on repeated sequences or by computing average IC across candidate key lengths. Then split the ciphertext into columns by key position and solve each column as an individual Caesar cipher using chi-squared frequency scoring.

What tools can automatically solve classical ciphers?▼

CyberChef handles encoding and common cipher operations, dcode.fr offers over 200 cipher solvers, quipqiup automates monoalphabetic substitution solving, xortool cracks XOR ciphers, and Ciphey attempts automated cipher detection and decryption.

Does frequency analysis work on transposition ciphers?▼

No, transposition ciphers preserve the original letter frequencies, so frequency analysis shows normal English distribution but scrambled text. Detect them by normal IC with unreadable plaintext, then brute force rail fence rail counts or try columnar transposition with common key lengths.

Why does my ciphertext analysis fail on Base64-encoded text?▼

Frequency analysis and IC only work on the raw cipher alphabet, not on encoded representations. Always decode Base64, hex, or binary encodings first, then re-run character set and frequency analysis on the decoded bytes.

When should I use known-plaintext attacks on classical ciphers?▼

Use known-plaintext attacks when you can guess part of the message, such as a flag prefix in CTF challenges. Crib dragging builds a partial substitution mapping, and for Hill ciphers two known plaintext-ciphertext matrix pairs allow full key recovery via modular matrix inversion.