AI Agent Hub
Back to skills
CTF Cryptography Quick Reference icon

CTF Cryptography Quick Reference

IT Ops & Security Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_257ad2a8/ctf-crypto.

About this skill

Problem

CTF crypto challenges often block on recognizing the attack surface: an AES-looking service may expose nonce reuse, RSA may have small exponents, nearby primes, or partial key leakage, an unknown XOR blob may be recoverable from file magic headers, stream-cipher LFSR tasks may require Berlekamp-Massey, and lattice tasks need LLL/BKZ triage before deeper analysis. This skill organizes cryptography challenges by algorithm family as a quick reference for choosing the right attack path first.

How It Works

  • Classic ciphers: start with Caesar, Vigenère, XOR, OTP key reuse, and file-header magic bytes to decide whether brute force, frequency analysis, or crib dragging applies.
  • Modern ciphers: covers AES-ECB, AES-CBC, CFB, padding oracle, nonce reuse, CBC bit flipping, HMAC/MAC forgery, and SRP bypass, with focus on oracles, block boundaries, weak key derivation, and authentication structure flaws.
  • RSA/ECC/lattices: maps common routes such as Wiener, Coppersmith, Hastad, partial-key recovery, fault attacks, invalid curves, ECDSA nonce reuse, and LLL/BKZ/LWE workflows.
  • Supporting resources: the main text gives one-line conclusions, while companion files add code and details, such as rsa-attacks.md, modern-ciphers-2.md, and lattice-and-lwe.md.

Boundaries

It fits best when the cryptography part is already isolated, with ciphertext, protocol parameters, or implementation clues available. If the blocker is reversing, disk forensics, network exploit development, model extraction, or misc encoding puzzles, switch to the corresponding direction instead of treating the task as pure cryptanalysis.

Use Cases

  • Given an unknown file suspected of XOR encryption, recover the initial key using PDF, PNG, or ZIP magic bytes.
  • Facing RSA ciphertext with a small e, decide whether cube root or Hastad broadcast can recover plaintext.
  • When analyzing an AES-CBC token, use padding oracle and bit flipping to forge privileged fields or inject parameters.
  • If a stream cipher shows consecutive-byte correlation, choose LFSR autocorrelation or RC4 bias analysis.

Best For

  • CTF competitors preparing crypto challenges who need to select the right attack tool by problem type.
  • Backend engineers debugging encrypted service authentication bypass and locating AES oracle or nonce-reuse flaws.
  • Application security engineers reviewing RSA parameters or key derivation to spot weak e or nearby p-q risks.
  • Researchers doing cryptography coursework or writeups who need algorithm-family code examples.