Given a signal in a CTF cryptography challenge, which attack applies? — start here: the signals, the attacks that hold, the dead ends, and where each is documented
This wiki holds 112 pages on CTF cryptography in 13 sections, each organised around the signal that betrays a weakness, the attack it leads to, field-tested operational detail, and a "What does NOT work" section for the dead ends. Across its pages, 2,442 claims were checked against the sources and 50 were refuted and corrected. Start from the signal you see in the challenge (a repeated nonce, a small private exponent, a smooth group order), open the page the section below points to, and read its "What does NOT work" part before investing time. Each statement below is sourced and qualified on the page it links to; read that page before relying on a number.
Takeaway
Identify the construction before the primitive: a reused CTR nonce, a small RSA private exponent, an anomalous curve or a reused ECDSA nonce each break by a known, cheap route, while length-extension on SHA-3, bigger round counts against a slide attack, and "double" encryption as a security gain do not behave the way they first appear.
The findings that hold
- A repeated CTR counter value loses all security. NIST SP 800-38A states that a counter value must never repeat under the same key or "all security is lost"; signals include ciphertext exactly as long as the plaintext and a fixed or hardcoded nonce in the source (https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf). The break recovers plaintext or keystream, never the key; see CTR Nonce Reuse — when the counter mode keystream repeats and Stream-Cipher Keystream Reuse — the umbrella break behind every reused-keystream challenge.
- Two independent keys add at most about one bit. Double encryption
C = E_k2(E_k1(P))falls to meet-in-the-middle in roughly2^(n+1)operations and2^nmemory for an n-bit key, which is why DES was standardised as triple, not double (https://en.wikipedia.org/wiki/Meet-in-the-middle_attack); see Double Encryption & MITM — composing two keys buys about one extra bit and Meet-in-the-Middle Attack — the time-memory tradeoff that breaks composed encryption. - A slide attack ignores the round count. It exploits self-similarity in the key schedule, so adding rounds to a cipher with a periodic schedule does not help (https://en.wikipedia.org/wiki/Slide_attack); see Slide Attack — breaking a cipher's key schedule, not its rounds.
- A strong round function does not imply a strong key schedule. Full AES-256 has only 7 key-expansion rounds carrying a 256-bit key across 14 cipher rounds, and a differential path exists with as few as 9 active bytes over the first 4 rounds; the page notes these results remain theoretical for real deployments and pay off in CTFs against home-rolled schedules (https://en.wikipedia.org/wiki/Related-key_attack); see Related-Key Attack — exploiting encryptions under keys with a known relationship.
- Profile the S-box before choosing the attack. The difference and linear approximation tables (DDT/LAT) tell you whether differential, linear or an algebraic break is the productive path; see S-box Analysis — profiling a cipher's S-box to pick the right statistical attack, Differential Cryptanalysis — chosen-plaintext XOR-difference propagation through S-boxes and Linear Cryptanalysis — known-plaintext linear approximation with a biased key parity bit.
- Small RSA private exponents fall to lattices. Boneh-Durfee recovers
d < N^0.292, beyond Wiener's proven bound ofd < (1/3)N^0.25(https://link.springer.com/chapter/10.1007/3-540-48910-X_1); its bound rests on a heuristic extension of Coppersmith's method; see Boneh-Durfee Attack — the lattice extension of Wiener that reaches d < N^0.292 and Wiener Attack — recovering RSA's private exponent when d is small, via continued fractions. - A reused ECDSA/DSA nonce gives the private key in closed form. Identical
rcollapses the key to two linear equations, with no discrete-log solving or lattice (https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm#Security); see ECDSA/DSA Nonce Reuse — identical r collapses the private key to closed-form algebra, ECDSA Fundamentals — the s*k = h + d*r identity that routes every nonce attack and, for related or biased nonces, Repeated / Linearly-Related Nonce Recovery — when nonces aren't reused, but ARE related by a known formula and DSA/ECDSA Biased-Nonce Lattice Attack — turning partial nonce leaks into a private-key recovery. - An anomalous curve is solved in polynomial time. When
#E(F_p) == p, the Smart attack solves the ECDLP in time linear in the bit-length ofp; see Smart Attack — the anomalous-curve signal that turns ECDLP into polynomial time and Elliptic Curve Discrete Logarithm Problem — the curve order's factorization picks your attack.
What does NOT work
- Length extension against SHA-3/SHAKE/Keccak fails because the capacity bits behind any squeeze are never revealed; SHA-3-256 has capacity 512, rate 1088 and
b= 1600 (https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf); see Sponge Construction — why length-extension does NOT work on SHA-3/Keccak. Length extension also fails against a genuine HMAC, because its nested construction requires the outer keyed hash (https://datatracker.ietf.org/doc/html/rfc2104); see HMAC Fundamentals — the nested MAC that tells you when to STOP trying length-extension. - Looking for repeated blocks inside one CTR message tells you nothing, and a padding oracle does not apply to CTR; see CTR Nonce Reuse — when the counter mode keystream repeats and CBC Padding Oracle — leak the intermediate decryption value one byte at a time.
- Using more rounds as a reason to give up on a slide attack, or sliding a cipher whose round function changes between rounds; see Slide Attack — breaking a cipher's key schedule, not its rounds.
- Trusting a meet-in-the-middle match from a single known-plaintext pair gives many spurious candidates; keep a second pair as a filter; see Double Encryption & MITM — composing two keys buys about one extra bit.
- Forcing the Smart attack when `E.order() != p`; fall back to Pohlig-Hellman — solving the discrete log when the group order is smooth or Singular Curve Attack — the zero-discriminant signal that collapses ECDLP to a field problem; see Smart Attack — the anomalous-curve signal that turns ECDLP into polynomial time.
- Treating Boneh-Durfee as an always-succeeding algorithm, unlike Wiener's rigorous argument; see Boneh-Durfee Attack — the lattice extension of Wiener that reaches d < N^0.292.
- Choosing differential or linear cryptanalysis before profiling the S-box; see S-box Analysis — profiling a cipher's S-box to pick the right statistical attack.
- Expecting a fast key from related-key results against an unmodified strong cipher; see Related-Key Attack — exploiting encryptions under keys with a known relationship.
- Assuming "it's not CBC" means "it's not bit-flippable": CTR/GCM share the keystream-XOR malleability, and only an authenticated mode stops it; see CBC Bit-Flipping — controlled tampering with no oracle needed.
Map
Per section, the pages that matter most (for sections marked, the full section is larger).
Block ciphers (17 pages, most important 10 listed)
- Block Cipher Modes of Operation — the mode carries the CTF vulnerability, not the primitive — Block Cipher Modes of Operation — the mode carries the CTF vulnerability, not the primitive
- CTR Nonce Reuse — when the counter mode keystream repeats — CTR Nonce Reuse — when the counter mode keystream repeats
- CBC Bit-Flipping — controlled tampering with no oracle needed — CBC Bit-Flipping — controlled tampering with no oracle needed
- CBC Padding Oracle — leak the intermediate decryption value one byte at a time — CBC Padding Oracle — leak the intermediate decryption value one byte at a time
- ECB Detection & Cut-and-Paste — the identical-block signal and how to weaponize it — ECB Detection & Cut-and-Paste — the identical-block signal and how to weaponize it
- Slide Attack — breaking a cipher's key schedule, not its rounds — Slide Attack — breaking a cipher's key schedule, not its rounds
- S-box Analysis — profiling a cipher's S-box to pick the right statistical attack — S-box Analysis — profiling a cipher's S-box to pick the right statistical attack
- Related-Key Attack — exploiting encryptions under keys with a known relationship — Related-Key Attack — exploiting encryptions under keys with a known relationship
- Meet-in-the-Middle Attack — the time-memory tradeoff that breaks composed encryption — Meet-in-the-Middle Attack — the time-memory tradeoff that breaks composed encryption
- Double Encryption & MITM — composing two keys buys about one extra bit — Double Encryption & MITM — composing two keys buys about one extra bit
RSA (17 pages, most important 10 listed)
- RSA Fundamentals — the routing hub: which artifact points to which attack — RSA Fundamentals — the routing hub: which artifact points to which attack
- Integer Factorization Methodology — which factoring attack to try, in what order — Integer Factorization Methodology — which factoring attack to try, in what order
- Wiener Attack — recovering RSA's private exponent when d is small, via continued fractions — Wiener Attack — recovering RSA's private exponent when d is small, via continued fractions
- Boneh-Durfee Attack — the lattice extension of Wiener that reaches d < N^0.292 — Boneh-Durfee Attack — the lattice extension of Wiener that reaches d < N^0.292
- Coppersmith's Method — recovering a small unknown from a modular polynomial via lattice reduction — Coppersmith's Method — recovering a small unknown from a modular polynomial via lattice reduction
- Common Modulus Attack — same n, two coprime exponents on the same message — Common Modulus Attack — same n, two coprime exponents on the same message
- Håstad's Broadcast Attack — recovering one plaintext from many small-e ciphertexts, no factoring — Håstad's Broadcast Attack — recovering one plaintext from many small-e ciphertexts, no factoring
- Small Public Exponent Attack — recovering m by an exact integer e-th root when m^e never wraps mod n — Small Public Exponent Attack — recovering m by an exact integer e-th root when m^e never wraps mod n
- Partial Key Exposure — recovering RSA when part of p or d has leaked — Partial Key Exposure — recovering RSA when part of p or d has leaked
- RSA LSB / Parity Oracle Attack — recover the plaintext one bit at a time from a decryption oracle — RSA LSB / Parity Oracle Attack — recover the plaintext one bit at a time from a decryption oracle
Hash functions and MACs (13 pages, most important 8 listed)
- Merkle–Damgård Construction — the digest IS the internal state — Merkle–Damgård Construction — the digest IS the internal state
- Hash Length Extension — forge H(secret‖msg‖extra) from a digest alone — Hash Length Extension — forge H(secret‖msg‖extra) from a digest alone
- HMAC Fundamentals — the nested MAC that tells you when to STOP trying length-extension — HMAC Fundamentals — the nested MAC that tells you when to STOP trying length-extension
- Sponge Construction — why length-extension does NOT work on SHA-3/Keccak — Sponge Construction — why length-extension does NOT work on SHA-3/Keccak
- MAC Forgery — the construction, not the primitive, decides the attack — MAC Forgery — the construction, not the primitive, decides the attack
- Birthday Attack — the square-root speedup that governs any collision search — Birthday Attack — the square-root speedup that governs any collision search
- CBC-MAC Forgery — splice a new message onto a known tag without the key — CBC-MAC Forgery — splice a new message onto a known tag without the key
- Poly1305 Nonce Issues — nonce reuse turns a one-time MAC into a solvable polynomial — Poly1305 Nonce Issues — nonce reuse turns a one-time MAC into a solvable polynomial
Signatures (7 pages)
- ECDSA Fundamentals — the s*k = h + d*r identity that routes every nonce attack — ECDSA Fundamentals — the s*k = h + d*r identity that routes every nonce attack
- DSA Fundamentals — the linear signing equation every DSA attack exploits — DSA Fundamentals — the linear signing equation every DSA attack exploits
- ECDSA/DSA Nonce Reuse — identical r collapses the private key to closed-form algebra — ECDSA/DSA Nonce Reuse — identical r collapses the private key to closed-form algebra
- DSA/ECDSA Biased-Nonce Lattice Attack — turning partial nonce leaks into a private-key recovery — DSA/ECDSA Biased-Nonce Lattice Attack — turning partial nonce leaks into a private-key recovery
- Repeated / Linearly-Related Nonce Recovery — when nonces aren't reused, but ARE related by a known formula — Repeated / Linearly-Related Nonce Recovery — when nonces aren't reused, but ARE related by a known formula
- Deterministic Nonce (RFC 6979) Failures — when 'no more RNG risk' still leaks the key — Deterministic Nonce (RFC 6979) Failures — when 'no more RNG risk' still leaks the key
- Signature Malleability — a valid (r,s) becomes another valid (r,s) without the key — Signature Malleability — a valid (r,s) becomes another valid (r,s) without the key
Elliptic curves (5 pages)
- Elliptic Curve Fundamentals — the audit that routes to the right ECC attack — Elliptic Curve Fundamentals — the audit that routes to the right ECC attack
- Elliptic Curve Discrete Logarithm Problem — the curve order's factorization picks your attack — Elliptic Curve Discrete Logarithm Problem — the curve order's factorization picks your attack
- Smart Attack — the anomalous-curve signal that turns ECDLP into polynomial time — Smart Attack — the anomalous-curve signal that turns ECDLP into polynomial time
- Singular Curve Attack — the zero-discriminant signal that collapses ECDLP to a field problem — Singular Curve Attack — the zero-discriminant signal that collapses ECDLP to a field problem
- Invalid Curve Attack — leaking an ECDH secret through a point nobody checked was on the curve — Invalid Curve Attack — leaking an ECDH secret through a point nobody checked was on the curve
Discrete log (4 pages)
- Discrete Logarithm — the factorization of the group order picks your algorithm — Discrete Logarithm — the factorization of the group order picks your algorithm
- Pohlig-Hellman — solving the discrete log when the group order is smooth — Pohlig-Hellman — solving the discrete log when the group order is smooth
- Baby-Step Giant-Step — the generic meet-in-the-middle solver for a mid-sized discrete log — Baby-Step Giant-Step — the generic meet-in-the-middle solver for a mid-sized discrete log
- Index Calculus — sub-exponential DLP attack for large prime fields with no smooth structure — Index Calculus — sub-exponential DLP attack for large prime fields with no smooth structure
Diffie–Hellman (10 pages)
- Diffie-Hellman Fundamentals — what to audit first in any DH challenge — Diffie-Hellman Fundamentals — what to audit first in any DH challenge
- Key-Exchange Methodology — triage any DH/ECDH challenge before reaching for heavy DLP machinery — Key-Exchange Methodology — triage any DH/ECDH challenge before reaching for heavy DLP machinery
- DH Small-Subgroup Attack — confining the secret to a tiny subgroup to leak it mod that order — DH Small-Subgroup Attack — confining the secret to a tiny subgroup to leak it mod that order
- DH Static-Key Reuse — turning a persistent secret exponent into a leaking oracle — DH Static-Key Reuse — turning a persistent secret exponent into a leaking oracle
- DH Man-in-the-Middle — unauthenticated exchange lets an active attacker relay two separate keys — DH Man-in-the-Middle — unauthenticated exchange lets an active attacker relay two separate keys
- DH Parameter Injection — tamper with (p, g) themselves to make the exchange breakable — DH Parameter Injection — tamper with (p, g) themselves to make the exchange breakable
- ElGamal Encryption — when the key is a discrete log, not a factored modulus — ElGamal Encryption — when the key is a discrete log, not a factored modulus
- ElGamal Malleability — scaling plaintext by a known factor without the private key — ElGamal Malleability — scaling plaintext by a known factor without the private key
- X25519 Basics — recognizing Curve25519 ECDH and where it actually breaks — X25519 Basics — recognizing Curve25519 ECDH and where it actually breaks
- DH Composite Modulus — splitting the discrete log by CRT when the modulus isn't prime — DH Composite Modulus — splitting the discrete log by CRT when the modulus isn't prime
Lattices (8 pages, most important 6 listed)
- Lattice Fundamentals — encoding a bounded unknown as a short vector — Lattice Fundamentals — encoding a bounded unknown as a short vector
- LLL Reduction — the polynomial-time workhorse behind almost every lattice attack — LLL Reduction — the polynomial-time workhorse behind almost every lattice attack
- Hidden Number Problem — recovering a secret from many small-bounded-error samples — Hidden Number Problem — recovering a secret from many small-bounded-error samples
- LWE Fundamentals — recognizing and breaking noisy linear equations mod q — LWE Fundamentals — recognizing and breaking noisy linear equations mod q
- Ring-LWE — recognizing polynomial-ring LWE and reducing it to plain LWE — Ring-LWE — recognizing polynomial-ring LWE and reducing it to plain LWE
- NTRU Fundamentals — recovering the short (f,g) key pair via lattice reduction — NTRU Fundamentals — recovering the short (f,g) key pair via lattice reduction
Number theory (13 pages, most important 7 listed)
- Smooth Numbers — the concept behind why Pollard p-1, Pohlig-Hellman, and index calculus work (and when they don't) — Smooth Numbers — the concept behind why Pollard p-1, Pohlig-Hellman, and index calculus work (and when they don't)
- Chinese Remainder Theorem — recombining residues across coprime moduli — Chinese Remainder Theorem — recombining residues across coprime moduli
- Quadratic Residues — deciding if x² ≡ a (mod n) has a solution before you go looking for one — Quadratic Residues — deciding if x² ≡ a (mod n) has a solution before you go looking for one
- Tonelli-Shanks — computing an actual modular square root, not just whether one exists — Tonelli-Shanks — computing an actual modular square root, not just whether one exists
- Polynomial GCD — the Euclidean algorithm on polynomials, and the trick that recovers a shared root — Polynomial GCD — the Euclidean algorithm on polynomials, and the trick that recovers a shared root
- Primality Testing — confirming a number is prime without factoring it — Primality Testing — confirming a number is prime without factoring it
- Carmichael Numbers & λ(n) — the true group exponent, and why a lone Fermat test lies — Carmichael Numbers & λ(n) — the true group exponent, and why a lone Fermat test lies
Stream ciphers and PRNGs (6 pages)
- Stream-Cipher Keystream Reuse — the umbrella break behind every reused-keystream challenge — Stream-Cipher Keystream Reuse — the umbrella break behind every reused-keystream challenge
- One-Time-Pad / Many-Time-Pad Reuse — the crib-drag break when a pad is used twice — One-Time-Pad / Many-Time-Pad Reuse — the crib-drag break when a pad is used twice
- Repeating-Key XOR — recovering key length and key from a Vigenère-style stream — Repeating-Key XOR — recovering key length and key from a Vigenère-style stream
- LFSR State Recovery — when the keystream itself hands you the seed — LFSR State Recovery — when the keystream itself hands you the seed
- Berlekamp-Massey Algorithm — recover the minimal LFSR from raw keystream — Berlekamp-Massey Algorithm — recover the minimal LFSR from raw keystream
- PRNG State Prediction — recovering the internal state of a non-cryptographic generator — PRNG State Prediction — recovering the internal state of a non-cryptographic generator
Side channels (5 pages)
- Timing Attack — recovering a secret from how long a secret-dependent operation takes — Timing Attack — recovering a secret from how long a secret-dependent operation takes
- Cache-Timing Attack — recovering key bytes from which cache line a table lookup touched — Cache-Timing Attack — recovering key bytes from which cache line a table lookup touched
- Power Analysis (SPA/DPA/CPA) — reading a key off a device's power draw — Power Analysis (SPA/DPA/CPA) — reading a key off a device's power draw
- Fault Injection Attacks — one faulty RSA-CRT signature factors the modulus outright — Fault Injection Attacks — one faulty RSA-CRT signature factors the modulus outright
- Error / Boolean Oracle Attack — turn any distinguishable valid/invalid response into a key or plaintext — Error / Boolean Oracle Attack — turn any distinguishable valid/invalid response into a key or plaintext
Methodology (4 pages)
- Cryptanalysis Methodology — classify the family before you reach for an attack — Cryptanalysis Methodology — classify the family before you reach for an attack
- Encoding and Decoding Layers — peel base64/hex/URL/compression first or you attack the wrong plaintext — Encoding and Decoding Layers — peel base64/hex/URL/compression first or you attack the wrong plaintext
- Custom Cipher Reverse — read the source, invert every primitive, run the pipeline backwards — Custom Cipher Reverse — read the source, invert every primitive, run the pipeline backwards
- Multi-Step Crypto Chain — recognizing and decomposing a pipeline challenge — Multi-Step Crypto Chain — recognizing and decomposing a pipeline challenge
Classical ciphers (3 pages)
- Affine Cipher — a tiny 312-key space that known-plaintext or brute force both break instantly — Affine Cipher — a tiny 312-key space that known-plaintext or brute force both break instantly
- Substitution & Shift Cipher — recovered by letter-frequency, not by algebra — Substitution & Shift Cipher — recovered by letter-frequency, not by algebra
- Vigenere Cipher — Kasiski / Index-of-Coincidence Key-Length Recovery — Vigenere Cipher — Kasiski / Index-of-Coincidence Key-Length Recovery
What is not known
This wiki has no dedicated section of open questions; where a page notes one, it does so inline, for example Lattice Fundamentals — encoding a bounded unknown as a short vector (a deterministic polynomial-time reduction proving exact SVP NP-hard remains open) and Boneh-Durfee Attack — the lattice extension of Wiener that reaches d < N^0.292 (its 0.292 bound rests on an unproven heuristic). Each page records its own confidence (between 0.65 and 0.9) and its checked-claim counts in its front matter; the lowest-confidence pages, such as NTRU Fundamentals — recovering the short (f,g) key pair via lattice reduction, Ring-LWE — recognizing polynomial-ring LWE and reducing it to plain LWE and Partial Key Exposure — recovering RSA when part of p or d has leaked (0.65), should be read with that in mind.
Verified against
- nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-3…
- nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
- link.springer.com/chapter/10.1007/3-540-48910-X_1
- en.wikipedia.org/wiki/Slide_attack
- en.wikipedia.org/wiki/Related-key_attack
- en.wikipedia.org/wiki/Meet-in-the-middle_attack
- datatracker.ietf.org/doc/html/rfc2104
- en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorith…
Source: Sinapsi — verified compositional memory, queryable by LLMs. Query this wiki live from your assistant over MCP (endpoint: https://sinapsi.wiki/mcp/w/ctf-crypto/), or build your own verified wiki (public, or private for your team). CC BY 4.0 — reuse with attribution to Sinapsi.