ctf-crypto

ctf-crypto is a skill for Claude Code from 26zl/cybersec-toolkit. It costs 78 tokens per session (1,598 once invoked), scanned A, original, MIT.

A guide to solving capture-the-flag, or CTF, cryptography challenges involving systems such as RSA, AES, elliptic-curve cryptography, hashes, random-number generators, and classical ciphers. It uses the clues in the input to select an attack or decoding method.

In plain words
What is it for?
Use it to identify encoded or encrypted data, inspect public keys, test RSA weaknesses, analyze cipher patterns, and choose specialized tools for decryption.
Why use it?
It helps turn an unknown ciphertext or key file into a set of concrete checks and possible approaches. This makes cryptography challenges easier to investigate systematically.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Part of the cybersec-toolkit plugin — 197 skills, 2 hooks, 1 MCP server shipped together

Good fit Use it to identify encoded or encrypted data, inspect public keys, test RSA weaknesses, analyze cipher patterns, and choose specialized tools for decryption.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/26zl/cybersec-toolkit/ctf-crypto
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 26zl/cybersec-toolkit --skill ctf-crypto
Clone the repo
git clone --depth 1 https://github.com/26zl/cybersec-toolkit

Made for: Claude Code.

Or install cybersec-toolkit, the plugin that ships this one along with the rest of its 197 skills, 2 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ctf-crypto

README.md
[![agentmods](https://agentmods.dev/badge/skills/26zl/cybersec-toolkit/ctf-crypto/github.svg)](https://agentmods.dev/skills/26zl/cybersec-toolkit/ctf-crypto)
Your own site
<a href="https://agentmods.dev/skills/26zl/cybersec-toolkit/ctf-crypto"><img src="https://agentmods.dev/badge/skills/26zl/cybersec-toolkit/ctf-crypto/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ctf-crypto

Your own site · 80×15
<a href="https://agentmods.dev/skills/26zl/cybersec-toolkit/ctf-crypto"><img src="https://agentmods.dev/badge/skills/26zl/cybersec-toolkit/ctf-crypto.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,598 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.01598
Opus 5 $0.00039 $0.00799
Sonnet 5 $0.00016 $0.00320
Haiku 4.5 $0.00008 $0.00160

Measured 2d ago against content hash 0ea064f3abac, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ctf-crypto scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Default first move: throw `n` at FactorDB (`run_tool("curl", "http://factordb.com/api?query=<n>")`) and at `RsaCtfTool` with all attacks enabled.
.claude/skills/ctf-crypto/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CTF crypto methodology

Tool-first: use suggest_for_ctf("crypto") first, then this checklist for depth.

0. Where the libraries live

Crypto work runs out of tools and into arithmetic fast. The installer puts the Python side in a venv the server can hand to scripts:

run_script(code, venv="crypto")   # ~/.ctf-venvs/crypto

Contents: pycryptodome (from Crypto...), sympy, gmpy2, numpy, z3, fpylll (+cysignals), cypari2. Install with ./install.sh --module crypto; check with check_installed("ctf-crypto-venv").

run_script is gated behind CYBERSEC_MCP_ALLOW_SCRIPTS=1 and is off by default. If a challenge needs solver code, say so and let the user enable it and restart the server — do not route around the gate with a shell.

SageMath is not installed by default — it is packaged on Debian and Arch but not in current Ubuntu, Fedora or openSUSE, and the image is 1.4 GB. --enable-docker pulls sagemath/sagemath:latest. Reach for it only for what the venv cannot do: Coppersmith with small_roots, Groebner bases, generic curve arithmetic.

1. Identify what you have

file <input>
xxd <input> | head -50
strings <input> | head -50
  • .pem, .pub → public key crypto (RSA/ECC)
  • BEGIN CERTIFICATE → x509 — extract pubkey with openssl x509 -in cert -pubkey -noout
  • High entropy ~7.99 bits/byte → encrypted/compressed
  • Repeating block patterns → ECB
  • Base64/hex prefix → decode first

2. RSA — the decision tree

Extract n, e, c:

openssl rsa -in pubkey.pem -pubin -text -noout

Then route by what n and e look like:

Symptom Attack Tool
Small e (3, 5), small message Cube root attack RsaCtfTool, python3 -c "from gmpy2 import iroot..."
n factorable on FactorDB Factor + decrypt RsaCtfTool --uncipher c -n n -e e
Two ciphertexts, same n, coprime e Common modulus RsaCtfTool --attack commonmodulus
Multiple users, small e=k, k pubkeys Håstad broadcast RsaCtfTool --attack hastads
Close p and q Fermat factorization RsaCtfTool --attack fermat
Wiener-applicable (d small) Wiener's RsaCtfTool --attack wiener
Partial p known Coppersmith sage / RsaCtfTool --attack boneh_durfee
Same m, two keys Common plaintext manual gcd

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed · +45 lines 0ea064f3abac
  2. 6d ago First seen · 93 lines · 78 tokens per session scan A ddc74700b13a

Subscribe to this mod's changes

ctf-crypto is a skill published in the GitHub repository 26zl/cybersec-toolkit (52 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 1,598 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

security-awareness

../../../governance/security-awareness/SKILL.md.

jaskaranhundal/usap-skills · 0 tokens

mobile-pentest

Mobile app pentest for bug bounty (Android APK + iOS IPA) — runtime-first workflow: install app, proxy through Burp/mitmproxy, drive the UI, capture packets, then test the API exactly like a web target; escalate to decompile (apktool/jadx) and Frida/objection only when traffic is SSL-pinned, encrypted, or absent.…

Awarexone/Agentic-Bug-Hunter · 205 tokens

exploiting-excessive-data-exposure-in-api

Tests APIs for excessive data exposure where endpoints return more data than the client application needs, relying on the frontend to filter sensitive fields. The tester intercepts API responses and analyzes them for leaked PII, internal identifiers, debug information, or sensitive business data that the UI does not…

xalgorix/xalgorix · 114 tokens

exploiting-jwt-algorithm-confusion-attack

Exploits JWT algorithm confusion vulnerabilities where the server's token verification library accepts the algorithm specified in the JWT header rather than enforcing a fixed algorithm. The tester manipulates the alg header to switch from RS256 to HS256 (using the RSA public key as the HMAC secret), sets alg to none…

xalgorix/xalgorix · 116 tokens

performing-api-inventory-and-discovery

Performs API inventory and discovery to identify all API endpoints in an organization's environment including documented, undocumented, shadow, zombie, and deprecated APIs. The tester uses passive traffic analysis, active scanning, DNS enumeration, JavaScript analysis, and cloud resource inventory to build a…

xalgorix/xalgorix · 100 tokens

performing-soap-web-service-security-testing

Perform security testing of SOAP web services by analyzing WSDL definitions and testing for XML injection, XXE, WS-Security bypass, and SOAPAction spoofing.

xalgorix/xalgorix · 41 tokens