agentleFS
MysterionRiseMysterionRise/ctf-kit/skills/crypto/SKILL.md

crypto

Skill12 starsChanged 9 months agoMITView on GitHub

Solve CTF cryptography challenges including encryption, hashing, and encoding. Use when you see: Base64 (trailing ==), hex strings (32/40/64 chars for MD5/SHA1/SHA256), RSA parameters (n=, e=, c=, p=, q=), XOR-encrypted data, .pem .key .enc files, classical ciphers (Caesar, Vigenere, substitution), encoding chains, or "crack this hash". Tools: xortool, hashid, hashcat, john, RsaCtfTool, openssl.

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this command for challenges involving:

    line 18
  2. Distinctive:

    Run the crypto analysis:

    line 37
  3. Very specific:

    All scripts produce a === PARSED RESULTS (JSON) === section.

    line 88
  4. Very specific:

    When using /ctf-kit:team-solve with a crypto challenge, the lead spawns 3 specialists:

    line 92

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CTF Crypto

Analyze and solve cryptography challenges.

When to Use

Use this command for challenges involving:

  • Encrypted text or files
  • Hash cracking
  • RSA/asymmetric cryptography
  • XOR encryption
  • Classical ciphers (Caesar, Vigenere, etc.)
  • Encoding chains (Base64, hex, etc.)

Bundled Scripts

  • check-tools.sh — Verify required crypto tools are installed
  • run-xortool.sh — Analyze XOR-encrypted files with key length detection. Outputs JSON with key lengths, probabilities, and cracking suggestions.
  • identify-hash.sh — Identify hash types from strings or files. Outputs JSON with hash type, hashcat mode numbers, and john format names.

Instructions

  1. First check tool availability: bash scripts/check-tools.sh
  2. Run the crypto analysis:

    ctf run crypto $ARGUMENTS
  3. For hash identification (outputs structured JSON with cracking commands):

    bash scripts/identify-hash.sh <hash-string>
    bash scripts/identify-hash.sh hashes.txt

    The JSON output includes:

    • hashes[].types[]: identified hash types with confidence
    • hashes[].types[].hashcat_mode: exact hashcat -m number
    • hashes[].types[].jtr_format: exact john --format value
    • suggestions: ready-to-run cracking commands
  4. For XOR analysis (outputs structured JSON with key candidates):

    bash scripts/run-xortool.sh <encrypted-file>
    bash scripts/run-xortool.sh <file> 8        # known key length
    bash scripts/run-xortool.sh <file> 8 20     # key length + most frequent char (space=0x20)

    The JSON output includes:

    • key_lengths[]: candidates with probability percentages
    • best_key_length: most probable key length
    • key_found: actual key if detected
    • decrypted_files: paths to decrypted candidates
  5. Based on JSON findings, chain to next tool:
    • Hash identified → run hashcat/john with the exact mode from JSON
    • XOR key found → decrypt with xortool-xor -n -s '<key>' <file>
    • RSA parameters → run RsaCtfTool -n <n> -e <e> --uncipher <c>

Common Patterns

PatternLikely Type
32 hex charsMD5 hash
40 hex charsSHA1 hash
64 hex charsSHA256 hash
== at endBase64
All caps + 2-7Base32
n=..., e=...RSA parameters

Output Format

All scripts produce a === PARSED RESULTS (JSON) === section. Use the suggestions array for ready-to-run next commands.

Team Roles

When using /ctf-kit:team-solve with a crypto challenge, the lead spawns 3 specialists:

RoleTeammate NameFocusToolsFirst Action
Classical & Encodingclassical-analystFrequency analysis, substitution ciphers, Vigenere, transposition, encoding chains (Base64/hex/ROT13)CyberChef, scripts/run-decode.sh, scripts/identify-hash.sh, dcode.frRun decode + hash-id on all files, check for known cipher patterns
Asymmetric & Mathrsa-specialistRSA factoring (small primes, Fermat, Wiener), padding oracles, Boneh-Durfee, ECC, Diffie-HellmanRsaCtfTool, openssl, sage, python3Extract RSA parameters (n,e,c), try RsaCtfTool, check factordb
Symmetric & Hashsymmetric-crackerXOR key recovery, AES mode attacks (ECB/CBC), hash cracking, HMACxortool, hashcat, john, scripts/run-xortool.shRun xortool on binary files, identify and crack any hashes

When to broadcast

  • Classical: "Identified cipher type as Vigenere with key length N" — RSA specialist can ignore
  • RSA: "Found factors of n" or "Need ciphertext in different format" — others adjust
  • Symmetric: "XOR key found: KEY" — others try decrypting their findings with it
  • Any: "Found the flag" — immediate broadcast, all stop

Example Usage

/ctf-kit:crypto cipher.txt
/ctf-kit:crypto encrypted.bin
/ctf-kit:crypto ./challenge/

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.