Install
$ agentstack add skill-02loveslollipop-opencrow-sagemath ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
OpenCROW Runner - SageMath
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.
Use this skill to execute SageMath reliably from the best detected Sage runtime.
Quick Start
Use the bundled runner:
python3 scripts/run_sage.py --code 'print(factor(2^20 - 1))'
Or execute an existing .sage file:
python3 scripts/run_sage.py --file /absolute/path/to/script.sage
Workflow
- Decide whether the task is best expressed as inline code or a
.sagefile. - For small one-off computations, pass the code with
--code. - For longer programs or reusable work, create a
.sagefile and pass it with--file. - For CTF crypto tasks, prefer Sage when the problem involves polynomial rings, finite fields, matrices over modular domains, lattices, or symbolic number theory operations.
- Review stdout/stderr from SageMath and report the meaningful result back to the user.
Runner Notes
- The runner probes
OPENCROW_SAGE, a Conda environment namedsage, and then a PATH-resolvedsagecommand. If all are missing it reports that exact capability gap. - For
--code, the runner writes the code into a temporary.sagefile first. This avoids quoting issues and keeps behavior aligned with file execution. - Pass
--timeout SECONDSwhen a computation may hang or run too long. - Pass
--keep-temponly when debugging generated Sage code.
Patterns
For inline calculations:
python3 scripts/run_sage.py --code '
R. = QQ[]
f = x^4 - 1
print(f.factor())
'
For file-based workflows:
- Create a
.sagefile in the workspace. - Run it with the bundled runner.
- If the script generates files, verify the outputs before replying.
For CTF cryptography workflows:
- Use Sage integer and modular arithmetic for RSA attacks, CRT reconstruction, inverses, and exponent relations.
- Use polynomial rings and
small_roots()for Coppersmith-style attacks when the instance is suitable. - Use
GF(p)or extension fields for ECC, finite-field equations, and structured algebraic recovery. - Use
Matrix,vector, and LLL for lattice-based recovery problems and hidden-number style attacks. - Use recurrence solving, modular equations, and matrix lifting for LCG, xorshift, and related PRNG state recovery when Sage algebra is useful.
References
- For CTF-oriented patterns and starter snippets, read [references/ctf-crypto.md](references/ctf-crypto.md) when the task involves RSA, ECC, lattices, or PRNG cryptanalysis.
Templates
- Copy or adapt [rsa-starter.sage](assets/templates/rsa-starter.sage) for modular arithmetic, CRT, and private-exponent recovery tasks.
- Copy or adapt [ecc-starter.sage](assets/templates/ecc-starter.sage) for finite-field and elliptic-curve exploration.
- Copy or adapt [lattice-lll-starter.sage](assets/templates/lattice-lll-starter.sage) for integer-lattice and hidden-structure attacks.
- Copy or adapt [lcg-state-recovery.sage](assets/templates/lcg-state-recovery.sage) for linear congruential generator recovery.
- Copy or adapt [xorshift-linear-model.sage](assets/templates/xorshift-linear-model.sage) for GF(2)-linear xorshift modeling.
- Copy or adapt [mersenne-twister-state-tools.sage](assets/templates/mersenne-twister-state-tools.sage) for MT19937 tempering and state-word recovery work.
- Copy or adapt [mt19937-partial-state-starter.sage](assets/templates/mt19937-partial-state-starter.sage) for partial-state or masked-bit MT analysis.
- Copy or adapt [mt19937-full-state-recovery.sage](assets/templates/mt19937-full-state-recovery.sage) for full 624-word MT state reconstruction from outputs.
- Copy or adapt [rsa-small-root-starter.sage](assets/templates/rsa-small-root-starter.sage) for Coppersmith-style experimentation with
small_roots(). - Copy or adapt [rsa-boneh-durfee-starter.sage](assets/templates/rsa-boneh-durfee-starter.sage) for low-private-exponent setup and polynomial construction.
- Copy or adapt [hidden-number-lattice-starter.sage](assets/templates/hidden-number-lattice-starter.sage) for nonce-bias and hidden-number lattice setups.
- Copy or adapt [ecdsa-nonce-reuse-starter.sage](assets/templates/ecdsa-nonce-reuse-starter.sage) for same-nonce ECDSA private-key recovery.
- Copy or adapt [ecdsa-partial-nonce-lattice-starter.sage](assets/templates/ecdsa-partial-nonce-lattice-starter.sage) for biased or partially leaked nonce lattice attacks.
- Copy or adapt [lcg-truncated-output-starter.sage](assets/templates/lcg-truncated-output-starter.sage) for recovering LCG state from high-bit leaks.
Resource
scripts/run_sage.py
Use this script instead of calling SageMath manually unless there is a specific reason not to. It standardizes environment selection, timeout handling, and inline-code execution.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: 02loveslollipop
- Source: 02loveslollipop/OpenCROW
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.