# Ctf Crypto

Provides cryptography attack techniques for CTF challenges.

- Repository: https://github.com/ljagiello/ctf-skills (3598 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add ljagiello/ctf-skills --skill ctf-crypto -g -a claude-code -y`
Codex: `npx skills add ljagiello/ctf-skills --skill ctf-crypto -g -a codex -y`
Cursor: `npx skills add ljagiello/ctf-skills --skill ctf-crypto -g -a cursor -y`
Gemini CLI: `npx skills add ljagiello/ctf-skills --skill ctf-crypto -g -a gemini-cli -y`

## Description

Provides cryptography attack techniques for CTF challenges. Use when attacking encryption, hashing, signatures, ZKP, PRNG, or mathematical crypto problems involving RSA, AES, ECC, lattices, LWE, CVP, number theory, Coppersmith, Pollard, Wiener, padding oracle, GCM, key derivation, or stream/block cipher weaknesses.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# CTF Cryptography

Quick reference for crypto CTF challenges. Each technique has a one-liner here; see supporting files for full details with code.

## Prerequisites

**Python packages (all platforms):**
```bash
pip install pycryptodome z3-solver sympy gmpy2 hashpumpy fpylll py_ecc
# Coppersmith (optional): pip install coppersmith
# Alternative Coppersmith lib: git clone https://github.com/jvdsn/crypto-attacks ~/.ctf-tools/crypto-attacks && pip install -r ~/.ctf-tools/crypto-attacks/requirements.txt
```

**Linux (apt):**
```bash
apt install hashcat
```

**macOS (Homebrew):**
```bash
brew install hashcat
```

**Manual install:**
- SageMath (optional, only for legacy Sage fallback snippets (collapsed sections)), Linux: `apt install sagemath`, macOS: `brew install --cask sage`
- RsaCtfTool, `git clone https://github.com/RsaCtfTool/RsaCtfTool` (automated RSA attacks)
- crypto-attacks (Coppersmith), `git clone https://github.com/jvdsn/crypto-attacks ~/.ctf-tools/crypto-attacks` + `pip install -r ~/.ctf-tools/crypto-attacks/requirements.txt` (alternative to `pip install coppersmith`)

> **Note:** `gmpy2` requires libgmp, Linux: `apt install libgmp-dev`, macOS: `brew install gmp`.

## Additional Resources

The rest: https://github.com/ljagiello/ctf-skills/blob/HEAD/ctf-crypto/SKILL.md
