crypto-analysis

majiayu000's avatarfrom majiayu000

Breaks cryptographic systems and decrypts ciphertext. Use when working with RSA, AES, XOR, classical ciphers, hash functions, or when challenge involves encryption, decryption, keys, or mathematical crypto attacks.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 5, 2026

When & Why to Use This Skill

This Claude skill is a comprehensive toolkit for cryptographic analysis and automated decryption. It enables the identification and breaking of various encryption schemes, including RSA, AES, XOR, and classical ciphers, by leveraging specialized tools and mathematical attack vectors. It is designed to streamline security auditing, vulnerability research, and the recovery of encrypted data.

Use Cases

  • Automated Decryption: Utilizing tools like Ciphey to automatically detect and decrypt unknown ciphertext without manual algorithm identification.
  • RSA Vulnerability Analysis: Executing specialized attacks such as Wiener's, Hastad's Broadcast, or Fermat Factorization to recover private keys from weak RSA implementations.
  • Cybersecurity Competitions (CTF): Rapidly solving complex cryptographic challenges involving lattice-based crypto, XOR analysis, and padding oracles.
  • Legacy Data Recovery: Decrypting historical files or communications where the original encryption parameters or keys have been partially lost or forgotten.
namecrypto-analysis
descriptionBreaks cryptographic systems and decrypts ciphertext. Use when working with RSA, AES, XOR, classical ciphers, hash functions, or when challenge involves encryption, decryption, keys, or mathematical crypto attacks.
allowed-toolsBash, Read, Write, Grep, Glob

Crypto Analysis Skill

Quick Workflow

Progress:
- [ ] Try Ciphey auto-decrypt first
- [ ] Identify crypto type (RSA/AES/XOR/classical)
- [ ] Check for known weaknesses
- [ ] Implement attack
- [ ] Decrypt flag

Step 1: Auto-Decrypt (Try First!)

ciphey -t "ENCODED_TEXT"    # Auto-detects and decrypts
ciphey -f encrypted.txt     # From file

Step 2: Identify Crypto Type

Pattern Crypto Type Reference
n, e, c variables RSA reference/rsa-attacks.md
16/32 byte key, IV AES reference/aes-attacks.md
XOR operations XOR/Stream reference/classical.md
Polynomial mod Lattice reference/lattice.md

RSA Attack Decision Tree

├── e small (≤5)?     → Direct eth root
├── e very large?     → Wiener's Attack
├── Multiple n,e,c?   → Hastad's Broadcast
├── Same n, diff e?   → Common Modulus
├── GCD(n1,n2) > 1?   → Common Factor
├── p ≈ q?            → Fermat Factorization
├── dp/dq leaked?     → Partial Key Recovery
└── Default           → FactorDB / yafu

Full implementations: reference/rsa-attacks.md

Quick Commands

# Auto-decrypt
ciphey -t "text"

# XOR analysis
xortool encrypted.bin
xortool -c 20 encrypted.bin  # Expect spaces

# Factor large n
yafu "factor(<n>)"

# RSA tool
python3 RsaCtfTool.py -n <n> -e <e> --uncipher <c>

# Lattice (SageMath)
sage solve.sage

Reference Files

  • RSA Attacks: Small e, Wiener, Hastad, Common Modulus, Fermat, FactorDB
  • AES Attacks: ECB detection, CBC flip, Padding Oracle
  • Classical/XOR: Ciphey, xortool, frequency analysis, Vigenère
  • Lattice: Coppersmith, LLL, HNP