classical-cipher-analysis
Classical cipher analysis playbook. Use when encountering substitution ciphers, Vigenere, transposition, XOR, or encoded text in CTF challenges that requires frequency analysis, Kasiski examination, or known-plaintext cryptanalysis.
Security Assessment
About classical-cipher-analysis
A classical cipher analysis playbook aimed at CTF challenges, emphasizing that the first job is correct identification before attempting to break anything. It provides a quick-identification guide that maps observable traits (all-uppercase with uneven frequency, flat frequency distribution, uniform letter shifts, Base64/hex/binary alphabets, Morse dots and dashes, digit pairs, scrambled letters, or non-printable XOR-like bytes) to a likely cipher and a first action, and warns that encoded ciphertext such as Base64 or hex must be decoded before cryptanalysis.
The identification methodology is spelled out in code: character-set analysis to detect encodings, letter-frequency analysis against English norms, the Index of Coincidence to distinguish monoalphabetic (IC around 0.065) from polyalphabetic (IC around 0.038) ciphers, and Kasiski examination to recover a Vigenere key length from repeated-sequence distances. From there it gives breaking techniques for the major classical families: monoalphabetic substitution via frequency mapping and known-plaintext crib dragging (for example a known flag prefix), and Caesar/ROT via 25-shift brute force scored with chi-squared against English frequencies.
Use it when a challenge presents substitution, Vigenere, transposition, XOR, or otherwise encoded text and you need a systematic path from raw ciphertext to plaintext. Per its load instruction, the skill also covers Vigenere, Enigma, affine, Hill, transposition, and Bacon/Polybius/Playfair ciphers alongside XOR (single and repeating key). It notes automated aids such as quipqiup.com and dcode.fr for substitution solving, and routes to related skills for modern symmetric ciphers (AES/DES), hash-based constructions, and lattice or knapsack attacks when the challenge falls outside the classical domain.
FAQ
What should I do before analyzing the cipher?
Identify it first. The skill stresses running character-set analysis to catch encodings; Base64 or hex ciphertext must be decoded before any cryptanalysis, and it warns against jumping to the wrong cipher type.
How do I tell a substitution cipher from a Vigenere?
Use the Index of Coincidence: about 0.065 indicates English or monoalphabetic substitution while about 0.038 indicates a polyalphabetic cipher like Vigenere. The frequency distribution shape is another signal.
How does it recover a Vigenere key length?
Kasiski examination: finding repeated sequences and computing the GCD and factors of the distances between them to surface the most likely key lengths.
How is a Caesar cipher solved?
By brute-forcing all 25 shifts and scoring each result with a chi-squared test against English letter frequencies, returning the lowest-scoring (closest to English) shift.
Does it help with known partial plaintext?
Yes. Crib dragging builds a partial substitution mapping from a known plaintext-ciphertext pair, such as a flag prefix, and applies it, marking unknown letters.
Install classical-cipher-analysis
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
yaklang/hack-skills