/ctf-security:crypto-classical-ciphersfrom ctf-security
Solve classical cipher CTF challenges including Caesar cipher, ROT-N, Vigenère cipher with Autokey variant, substitution ciphers (monoalphabetic and polyalphabetic), transposition ciphers (rail-fence, columnar), Playfair cipher, and other historical encryption methods. Use when analyzing text-only ciphertext, challenges mentioning historical or classical ciphers, frequency analysis opportunities, or when ciphertext contains only letters without numbers. Includes automated solvers for Caesar/ROT-N with all 26 shifts, Vigenère key recovery using Kasiski examination and index of coincidence, frequency analysis for substitution ciphers, dcode.fr and CyberChef integration, complete statistical analysis tools, and English/Italian language frequency tables for OliCyber.IT challenges. Beginner-friendly entry point to CTF cryptography.
Ships in ctf-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Beginner-friendly guide to solving classical cipher challenges in CTFs. Classical ciphers are common entry-level crypto challenges that rely on pattern recognition and statistical analysis rather than complex mathematics.
Use this skill when you encounter:
Only letters, uniform distribution → Vigenère or polyalphabetic
Only letters, peaked distribution → Caesar or substitution
Repeated patterns visible → Vigenère (repeating key)
No pattern, looks random → Modern crypto (not classical)
Rearranged but same letters → Transposition cipher
Easiest CTF cipher - always try first!
# Brute force all 26 shifts
for shift in range(26):
plaintext = ''.join(chr((ord(c) - ord('A') + shift) % 26 + ord('A'))
for c in ciphertext.upper())
print(f"Shift {shift}: {plaintext}")
Online: dcode.fr/caesar-cipher (auto-solver)
Most common classical cipher in CTFs
Attack Steps:
# See scripts/vigenere_solver.py for full implementation
# Or use dcode.fr/vigenere-cipher (automatic solver)
Each letter maps to one other letter
Attack: Frequency analysis
# See scripts/frequency_analyzer.py and scripts/substitution_breaker.py
# Or use dcode.fr/monoalphabetic-substitution
Letters rearranged, not substituted
Types:
Tools: dcode.fr/rail-fence-cipher, dcode.fr/columnar-transposition-cipher
Features:
Workflow:
1. Visit dcode.fr
2. Use "Cipher Identifier" with your ciphertext
3. Try top 3 suggested ciphers
4. Use cipher-specific auto-solver
5. Verify result makes sense
URL: https://gchq.github.io/CyberChef/
Best for:
Automated solvers included:
scripts/caesar_solver.py - Brute force all shiftsscripts/vigenere_solver.py - Full Vigenère breakerscripts/frequency_analyzer.py - Statistical analysisscripts/substitution_breaker.py - Monoalphabetic attackE: 12.7% T: 9.1% A: 8.2%
O: 7.5% I: 7.0% N: 6.7%
S: 6.3% H: 6.1% R: 6.0%
Common digraphs: TH, HE, IN, ER, AN Common trigraphs: THE, AND, ING, HER, FOR
E: 11.8% A: 11.7% I: 11.3%
O: 9.8% L: 6.5% R: 6.4%
See: references/frequency_tables.md for complete data
1. Check character set (only letters? numbers? symbols?)
2. Calculate Index of Coincidence (IC)
- IC ≈ 0.065: English plaintext or monoalphabetic
- IC ≈ 0.045: Polyalphabetic (Vigenère)
- IC ≈ 0.038: Random or modern crypto
3. Use dcode.fr Cipher Identifier
1. dcode.fr auto-solvers (fastest for common ciphers)
2. CyberChef operations
3. Python scripts from this skill
1. Frequency analysis (scripts/frequency_analyzer.py)
2. Pattern recognition (look for THE, AND, etc.)
3. Kasiski examination (for Vigenère key length)
4. Trial and error with common patterns
1. Check if result is readable English/Italian
2. Look for flag format (CTF{...}, flag{...}, etc.)
3. Verify with challenge description
Most important classical cipher for CTFs
# Find repeating sequences
# Distance between repetitions = multiple of key length
# Example: "ABC" appears at positions 0, 15, 30
# GCD(15, 30) = 15 → key length likely 15 or factor of 15
# Test different key lengths
# Correct key length shows higher IC (closer to 0.065)
# See scripts/vigenere_solver.py for implementation
# Once key length known:
# 1. Split ciphertext into groups (every nth character)
# 2. Each group is Caesar cipher
# 3. Use frequency analysis on each group
# 4. Recover key character by character
Automated: dcode.fr/vigenere-cipher with automatic mode
# Always normalize to uppercase for classical ciphers
ciphertext = ciphertext.upper()
# Remove non-letters
ciphertext = ''.join(c for c in ciphertext if c.isalpha())
# Italian challenges (OliCyber.IT) use Italian frequencies
# Check challenge source/language
# Use appropriate frequency table
# dcode.fr auto-solvers work on 90%+ of classical cipher CTF challenges
# Always try dcode.fr BEFORE manual analysis
# Saves significant time
# Start with simplest cipher (Caesar) before complex ones
# Try ROT13 first (common in CTFs)
# Don't assume advanced technique if simple one works
def caesar_decrypt(ciphertext, shift):
result = ""
for char in ciphertext.upper():
if char.isalpha():
result += chr((ord(char) - ord('A') - shift) % 26 + ord('A'))
else:
result += char
return result
# Try all shifts
for shift in range(26):
print(f"Shift {shift}: {caesar_decrypt(ciphertext, shift)}")
from collections import Counter
def frequency_analysis(text):
text = ''.join(c for c in text.upper() if c.isalpha())
freq = Counter(text)
total = sum(freq.values())
for char, count in freq.most_common():
percentage = 100 * count / total
print(f"{char}: {count:4d} ({percentage:5.2f}%)")
def index_of_coincidence(text):
text = ''.join(c for c in text.upper() if c.isalpha())
N = len(text)
freq = Counter(text)
ic = sum(n * (n - 1) for n in freq.values()) / (N * (N - 1))
return ic
# Interpretation:
# IC ≈ 0.065: Monoalphabetic (Caesar, substitution)
# IC ≈ 0.045: Polyalphabetic (Vigenère)
# IC ≈ 0.038: Random or modern encryption
Remember: Classical ciphers are entry-level CTF challenges designed to teach cryptanalysis basics. They should be solved quickly (< 30 minutes) using automated tools.
Success Strategy:
Quick Navigation:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub giofornari/skills --plugin ctf-security7 skills in this plugin
/crypto-general-methodologyComprehensive methodology for solving CTF cryptography challenges including workflow guidance, cipher identification, reconnaissance techniques, tool selection strategy, and challenge categorization. Use when approaching any crypto CTF challenge, need to identify unknown ciphers or encodings, select appropriate tools (dcode.fr, factordb, CyberChef, SageMath, RsaCtfTool), develop attack strategies, or understand crypto challenge patterns. Covers classical ciphers, RSA, AES, block ciphers, PRNG, hash functions, zero-knowledge proofs, encoding detection, and cross-category exploitation techniques. Includes decision trees, cheatsheets for SageMath and PyCryptodome, and systematic approaches for reconnaissance and cryptanalysis./crypto-rsa-attacksExploit RSA vulnerabilities in CTF challenges including factorization attacks (factordb lookup, Fermat factorization, Pollard rho), Wiener's attack on small private exponents, small public exponent attacks (low e, Hastad broadcast), common modulus attacks, padding oracle attacks, multi-prime RSA, Franklin-Reiter related message attacks, and Coppersmith methods. Use when analyzing RSA encryption challenges, working with public keys (n, e, d, p, q, c parameters), attacking weak RSA implementations, recovering plaintexts from RSA ciphertexts, exploiting mathematical relationships in RSA systems, or factoring composite numbers. Includes RsaCtfTool automation, factordb integration, SageMath implementations for Wiener and lattice attacks, complete working Python scripts for all major RSA attack categories, and practical CTF examples from ASIS, CSAW, PlaidCTF, Google CTF, and other major competitions.