opencrow-crypto-toolbox
Use the Anaconda `ctf` environment and installed crypto tooling for CTF tasks that fit normal Python or CLI cracking rather than SageMath. Use when Codex needs `z3`, `fpylll`, `pycryptodome`, `hashcat
Files5
View on GitHubSKILL.mdskills/opencrow-crypto-toolbox/SKILL.md
GitHubOpenCROW Crypto Toolbox
Runtime preflight
Probe required commands with command -v and Python modules with importlib.util.find_spec before use. Prefer a PATH-resolved OpenCROW MCP helper or the ctf/sage environment when available, then the managed helper or system Python. If a capability is missing, stop that path safely and report the exact missing command or module.
Prefer the opencrow-crypto-mcp server for typed crypto workflows. Fall back to the direct scripts only when you need to debug the underlying ctf-environment execution path.
MCP First
- Use
toolbox_info,toolbox_verify, andtoolbox_capabilitiesfirst. - Use the typed crypto operations:
crypto_pythoncrypto_factordb_lookupcrypto_crack_hash
- Treat the existing helper scripts as the implementation fallback, not the primary interface.
Use this skill for Python-first crypto work in the ctf environment plus the cracking and lookup tools that commonly complement it. This covers SMT constraints with z3, lattice work with fpylll, implementation helpers with pycryptodome, offline cracking with hashcat or john, and quick FactorDB checks.
Quick Start
Run inline Python in ctf:
python3 scripts/run_crypto_python.py --code 'from z3 import *; x = BitVec("x", 32); s = Solver(); s.add(x ^ 0x1337 == 0x1234); print(s.check()); print(s.model())'
Run a solver file:
python3 scripts/run_crypto_python.py --file /absolute/path/to/solve.py
Verify the mapped stack:
python3 scripts/verify_toolkit.py
Query FactorDB quickly:
python3 scripts/factordb_lookup.py 999630013489
Workflow
- Use this toolbox when the job is mostly Python, constraints, lattices, or byte-level crypto helpers.
- Use
run_crypto_python.py --codefor short experiments and--filefor real solve scripts. - Reach for
z3when the challenge is equation- or bit-vector-driven. - Reach for
fpylllwhen the attack is lattice-driven and does not require Sage. - Reach for
pycryptodomewhen you need standard primitives, block modes, or protocol glue in Python. - Reach for
hashcatorjohnwhen the fastest path is cracking rather than symbolic recovery. - Read references/tooling.md if you need a quick selection guide.
Tool Selection
- Use
z3for SAT/SMT solving, bit-vectors, modular constraints, and key-recovery models that can be expressed symbolically. - Use
fpylllfor LLL/BKZ lattice reduction, CVP experiments, and short-vector workflows in plain Python. - Use
pycryptodomefor AES, RSA helpers, hashes, MACs, padding, byte parsing, and challenge protocol implementation. - Use
hashcatfor local cracking workloads and mask, rule, or wordlist-based attacks. - Use
johnwhen a format is better supported by John or when you want a lighter cracking loop. - Use
factordb_lookup.pyfor quick sanity checks against known integer factorizations before committing to local factoring work. - Use standard Python libraries in the same script for parsing challenge formats, padding oracles, byte wrangling, and protocol glue.
- Switch to
sagemathwhen the task needs finite fields, elliptic curves, polynomial rings, or Sage-native attack code.
Resources
scripts/run_crypto_python.py: execute inline code or a.pyfile inside thectfenvironment.scripts/verify_toolkit.py: confirm that the crypto-specific Python modules are available.scripts/factordb_lookup.py: look up known factors through the public FactorDB API.references/tooling.md: quick guidance on when to stay in Python crypto tooling versus switching to Sage.