Ctf Crypto
CLAWHUB · Unverified
Provides cryptography attack techniques for CTF challenges. Use when attacking encryption, hashing, signatures, ZKP, PRNG, or mathematical crypto problems in... Skill: Ctf Crypto Owner: gandli Summary: Provides cryptography attack techniques for CTF challenges. Use when attacking encryption, hashing, signatures, ZKP, PRNG, or mathematical crypto problems in... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-03-30T10:23:51.251Z | auto Initial release of ctf-crypto: a comprehensive reference for CTF cryptography attacks. - Provides structured quick-access to cryptanalysis te
- 62
- Rank
- 84
- Safety
- 1.3k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 10, 2026
- Adoption signal
- 1.3K downloadsadoption · Oct 10, 2026
- Latest release
- 1.0.0release · Mar 30, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.0release
Initial release of ctf-crypto: a comprehensive reference for CTF cryptography attacks. - Provides structured quick-access to cryptanalysis techniques for classic/modern ciphers, RSA, ECC, PRNGs, lattices, ZKP, and more. - Includes prerequisites for Python tools and system packages to support attack scripts. - Lists detailed supporting files covering a wide variety of attack scenarios and edge cases. - Offers practical command-line quick-starts for cipher identification, factorization, and core attacks. - Guidance on when to pivot to other CTF skills for non-crypto challenges.
Observed Mar 30, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s17c214vqwcqpk2wczqpbmyngd83xsas:ctf-crypto- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-gandli-ctf-crypto/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
141,578 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: ctf-crypto 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. license: MIT compatibility: Requires filesystem-based agent (Claude Code or similar) with bash, Python 3, and internet access for tool installation. allowed-tools: Bash Read Write Edit Glob Grep Task WebFetch WebSearch metadata: user-invocable: "false" --- # 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 ``` **Linux (apt):** ```bash apt install hashcat sagemath ``` **macOS (Homebrew):** ```bash brew install hashcat ``` **Manual install:** - SageMath — Linux: `apt install sagemath`, macOS: `brew install --cask sage` - RsaCtfTool — `git clone https://github.com/RsaCtfTool/RsaCtfTool` (automated RSA attacks) > **Note:** `gmpy2` requires libgmp — Linux: `apt install libgmp-dev`, macOS: `brew install gmp`. ## Additional Resources - [classic-ciphers.md](classic-ciphers.md) - Classic ciphers: Vigenere (+ Kasiski examination), Atbash, substitution wheels, XOR variants (+ multi-byte frequency analysis), deterministic OTP, cascade XOR, book cipher, OTP key reuse / many-time pad, variable-length homophonic substitution, grid permutation cipher keyspace reduction, image-based Caesar shift ciphers, XOR key recovery via file format headers - [modern-ciphers.md](modern-ciphers.md) - Modern cipher attacks: AES (CFB-8, ECB leakage), CBC-MAC/OFB-MAC, padding oracle, S-box collisions, GF(2) elimination, LCG partial output recovery, affine cipher over composite modulus, AES-GCM with derived keys, AES-GCM nonce reuse (forbidden attack), Ascon-like reduced-round differential cryptanalysis, custom linear MAC forgery, CBC padding oracle (full block decryption), Bleichenbacher RSA PKCS#1 v1.5 padding oracle (ROBOT), birthday attack / meet-in-the-middle, CRC32 collision signature forgery, AES key recovery via byte-by-byte zeroing oracle - [modern-ciphers-2.md](modern-ciphers-2.md) - Modern cipher attacks (continued): Blum-Goldwasser bit-extension oracle, hash length extension, compression oracle (CRIME-style), hash function time reversal via cycle detection, OFB mode invertible RNG backward decryption, weak key derivation via public key hash XOR, HMAC-CRC linearity attack, DES weak keys in OFB mode, SRP protocol bypass, modified AES S-Box brute-force, square attack on reduced-round AES, AES-ECB byte-at-a-time chosen plaintext, AES-ECB cut-and-paste block manipulation, AES-CBC IV bit-flip auth bypass, Rabin LSB parity oracle, PBKDF2 pre-hash bypass, MD5 multi-collision via fastcol, custom
_meta.json
{
"ownerId": "kn73f0qbrqrt12rtz7g229bjy9812vjv",
"slug": "ctf-crypto",
"version": "1.0.0",
"publishedAt": 1774866231251
}advanced-math.md
# CTF Crypto - Advanced Mathematical Attacks
## Table of Contents
- [Elliptic Curve Isogenies](#elliptic-curve-isogenies)
- [Pohlig-Hellman Attack (Weak ECC)](#pohlig-hellman-attack-weak-ecc)
- [Baby-Step Giant-Step for General DLP](#baby-step-giant-step-for-general-dlp)
- [LLL Algorithm for Approximate GCD](#lll-algorithm-for-approximate-gcd)
- [Merkle-Hellman Knapsack Cryptosystem via LLL (ASIS 2014)](#merkle-hellman-knapsack-cryptosystem-via-lll-asis-2014)
- [Coppersmith's Method (Close Private Keys)](#coppersmiths-method-close-private-keys)
- [Coppersmith's Method (Structured Primes, LACTF 2026)](#coppersmiths-method-structured-primes-lactf-2026)
- [Clock Group (x^2+y^2=1 mod p) DLP (LACTF 2026)](#clock-group-x2y21-mod-p-dlp-lactf-2026)
- [Quaternion RSA](#quaternion-rsa)
- [Polynomial Arithmetic in GF(2)[x]](#polynomial-arithmetic-in-gf2x)
- [RSA Signing Bug](#rsa-signing-bug)
- [Non-Permutation S-box Collision Attack (Nullcon 2026)](#non-permutation-s-box-collision-attack-nullcon-2026)
- [Polynomial CRT in GF(2)[x] (Nullcon 2026)](#polynomial-crt-in-gf2x-nullcon-2026)
- [Manger's RSA Padding Oracle Attack (Nullcon 2026)](#mangers-rsa-padding-oracle-attack-nullcon-2026)
- [LWE Lattice Attack via CVP (EHAX 2026)](#lwe-lattice-attack-via-cvp-ehax-2026)
- [Affine Cipher over Non-Prime Modulus (Nullcon 2026)](#affine-cipher-over-non-prime-modulus-nullcon-2026)
- [Introspective CRC via GF(2) Linear Algebra (Google CTF 2017)](#introspective-crc-via-gf2-linear-algebra-google-ctf-2017)
- [Baby-Step Giant-Step for Sparse/Low Hamming Weight Exponents (SEC-T CTF 2017)](#baby-step-giant-step-for-sparselow-hamming-weight-exponents-sec-t-ctf-2017)
---
## Elliptic Curve Isogenies
Isogeny-based crypto challenges are often **graph traversal problems in disguise**:
**Key concepts:**
- j-invariant uniquely identifies curve isomorphism class
- Curves connected by isogenies form a graph (often tree-like)
- Degree-2 isogenies: each node has ~3 neighbors (2 children + 1 parent)
**Modular polynomial approach:**
- Connected j-invariants j₁, j₂ satisfy Φ₂(j₁, j₂) = 0
- Find neighbors by computing roots of Φ₂(j, Y) in the finite field
- Much faster than computing actual isogenies
**Pathfinding in isogeny graphs:**
```python
# Height estimation via random walks to leaves
def estimate_height(j, neighbors_func, trials=100):
min_depth = float('inf')
for _ in range(trials):
depth, curr = 0, j
while True:
nbrs = neighbors_func(curr)
if len(nbrs) <= 1: # leaf node
break
curr = random.choice(nbrs)
depth += 1
min_depth = min(min_depth, depth)
return min_depth
# Find path between two nodes via LCA
def find_path(start, end):
# Ascend from both nodes tracking heights
# Find least common ancestor
# Concatenate: path_up(start) + reversed(path_up(end))
```
**Complex multiplication (CM) curves:**
- Discriminant D = f² · D_K where D_K is fundamental discriminant
- classic-ciphers.md
# CTF Crypto - Classic Ciphers
## Table of Contents
- [Vigenere Cipher](#vigenere-cipher)
- [Atbash Cipher](#atbash-cipher)
- [Polybius Square Cipher (Qiwi-Infosec 2016)](#polybius-square-cipher-qiwi-infosec-2016)
- [Substitution Cipher with Rotating Wheel](#substitution-cipher-with-rotating-wheel)
- [Kasiski Examination for Key Length](#kasiski-examination-for-key-length)
- [XOR Variants](#xor-variants)
- [Multi-Byte XOR Key Recovery via Frequency Analysis](#multi-byte-xor-key-recovery-via-frequency-analysis)
- [Cascade XOR (First-Byte Brute Force)](#cascade-xor-first-byte-brute-force)
- [XOR with Rotation: Power-of-2 Bit Isolation (Pragyan 2026)](#xor-with-rotation-power-of-2-bit-isolation-pragyan-2026)
- [Weak XOR Verification Brute Force (Pragyan 2026)](#weak-xor-verification-brute-force-pragyan-2026)
- [Deterministic OTP with Load-Balanced Backends (Pragyan 2026)](#deterministic-otp-with-load-balanced-backends-pragyan-2026)
- [OTP Key Reuse / Many-Time Pad XOR (BYPASS CTF 2025)](#otp-key-reuse--many-time-pad-xor-bypass-ctf-2025)
- [Book Cipher](#book-cipher)
- [Variable-Length Homophonic Substitution (ASIS CTF Finals 2013)](#variable-length-homophonic-substitution-asis-ctf-finals-2013)
- [Grid Permutation Cipher Keyspace Reduction (BSidesSF 2026)](#grid-permutation-cipher-keyspace-reduction-bsidessf-2026)
- [Image-Based Caesar Shift Ciphers (BSidesSF 2026)](#image-based-caesar-shift-ciphers-bsidessf-2026)
- [Variant A — Vertical Strip Shift (caesar1)](#variant-a--vertical-strip-shift-caesar1)
- [Variant B — Horizontal Shift with ASCII Encoding (caesar2)](#variant-b--horizontal-shift-with-ascii-encoding-caesar2)
- [XOR Key Recovery via File Format Headers (MetaCTF Flash 2026)](#xor-key-recovery-via-file-format-headers-metactf-flash-2026)
---
## Vigenere Cipher
**Known Plaintext Attack (most common in CTFs):**
```python
def vigenere_decrypt(ciphertext, key):
result = []
key_index = 0
for c in ciphertext:
if c.isalpha():
shift = ord(key[key_index % len(key)].upper()) - ord('A')
base = ord('A') if c.isupper() else ord('a')
result.append(chr((ord(c) - base - shift) % 26 + base))
key_index += 1
else:
result.append(c)
return ''.join(result)
def derive_key(ciphertext, plaintext):
"""Derive key from known plaintext (e.g., flag format CCOI26{)"""
key = []
for c, p in zip(ciphertext, plaintext):
if c.isalpha() and p.isalpha():
c_val = ord(c.upper()) - ord('A')
p_val = ord(p.upper()) - ord('A')
key.append(chr((c_val - p_val) % 26 + ord('A')))
return ''.join(key)
```
### Kasiski Examination for Key Length
When no known plaintext is available, determine the Vigenere key length using Kasiski examination: find repeated sequences in the ciphertext and compute the GCD of their distances.
```python
from math import gcd
from functools import reduce
from collections import Counter
def kasiskiecc-attacks.md
# CTF Crypto - Elliptic Curve Attacks ## Table of Contents - [Small Subgroup Attacks](#small-subgroup-attacks) - [Invalid Curve Attacks](#invalid-curve-attacks) - [Singular Curves](#singular-curves) - [Smart's Attack (Anomalous Curves)](#smarts-attack-anomalous-curves) - [ECC Fault Injection](#ecc-fault-injection) - [Clock Group DLP via Pohlig-Hellman (LACTF 2026)](#clock-group-dlp-via-pohlig-hellman-lactf-2026) - [ECDSA Nonce Reuse (BearCatCTF 2026)](#ecdsa-nonce-reuse-bearcatctf-2026) - [Ed25519 Torsion Side Channel (BearCatCTF 2026)](#ed25519-torsion-side-channel-bearcatctf-2026) - [DSA Nonce Reuse for Private Key Recovery (VolgaCTF 2016)](#dsa-nonce-reuse-for-private-key-recovery-volgactf-2016) - [DSA Limited k-Value Brute Force (ASIS CTF Finals 2016)](#dsa-limited-k-value-brute-force-asis-ctf-finals-2016) - [ECC Shared Prime Factor via GCD (ASIS CTF Finals 2016)](#ecc-shared-prime-factor-via-gcd-asis-ctf-finals-2016) - [DSA Key Recovery via MD5 Collision on k-Generation (CONFidence CTF 2017)](#dsa-key-recovery-via-md5-collision-on-k-generation-confidence-ctf-2017) --- ## Small Subgroup Attacks - Check curve order for small factors - Pohlig-Hellman: solve DLP (Discrete Logarithm Problem) in small subgroups, combine with CRT (Chinese Remainder Theorem) ```python # SageMath ECC basics E = EllipticCurve(GF(p), [a, b]) G = E.gens()[0] # generator order = E.order() ``` **Key insight:** When the curve order has small prime factors, Pohlig-Hellman decomposes the DLP into small subgroup problems solvable independently, then combines results with CRT. Always factor the curve order first -- if it is smooth (all small factors), the DLP is trivially solvable. --- ## Invalid Curve Attacks If point validation is missing, send points on weaker curves. Craft points with small-order subgroups to leak secret key bits. **Key insight:** Invalid curve attacks exploit missing point-on-curve validation. Send crafted points that lie on a different curve with a small-order subgroup, and the server will compute scalar multiplication on the weak curve, leaking secret key bits modulo the small order. --- ## Singular Curves If discriminant delta = 0, curve is singular. DLP becomes easy (maps to additive/multiplicative group). **Key insight:** Check the discriminant `4a^3 + 27b^2 mod p` first. If it is zero, the curve is singular and the ECDLP reduces to a simple discrete log in the additive group (cusp) or multiplicative group (node) of the field, both solvable in polynomial time. --- ## Smart's Attack (Anomalous Curves) **When to use:** Curve order equals field characteristic p (anomalous curve). Solves ECDLP in O(1) via p-adic lifting. **Key insight:** Always check `E.order() == p` first. If the curve order equals the field prime, the ECDLP is solved instantly via p-adic lifting (Smart's attack). SageMath's `discrete_log` handles this automatically, but manual p-adic lift code is needed when the built-in method fails. **Detection:** `E.order() == p`
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-gandli-ctf-crypto. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about Ctf Crypto. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-gandli-ctf-crypto, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/gandli/skills/ctf-crypto",
"sourceUrl": "https://clawhub.ai/gandli/skills/ctf-crypto",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T16:34:13.604Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-gandli-ctf-crypto/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-gandli-ctf-crypto/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T16:34:13.604Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.3K downloads",
"href": "https://clawhub.ai/gandli/ctf-crypto",
"sourceUrl": "https://clawhub.ai/gandli/ctf-crypto",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T16:34:13.604Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.0",
"href": "https://clawhub.ai/gandli/ctf-crypto",
"sourceUrl": "https://clawhub.ai/gandli/ctf-crypto",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-30T10:23:51.251Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-gandli-ctf-crypto/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-gandli-ctf-crypto/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.0",
"description": "Initial release of ctf-crypto: a comprehensive reference for CTF cryptography attacks. - Provides structured quick-access to cryptanalysis techniques for classic/modern ciphers, RSA, ECC, PRNGs, lattices, ZKP, and more. - Includes prerequisites for Python tools and system packages to support attack scripts. - Lists detailed supporting files covering a wide variety of attack scenarios and edge cases. - Offers practical command-line quick-starts for cipher identification, factorization, and core attacks. - Guidance on when to pivot to other CTF skills for non-crypto challenges.",
"href": "https://clawhub.ai/gandli/ctf-crypto",
"sourceUrl": "https://clawhub.ai/gandli/ctf-crypto",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-30T10:23:51.251Z",
"isPublic": true
}
]
}Record generated Nov 23, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-gandli-ctf-crypto/run-check
