Applied cryptography for attackers

Applied cryptography for attackers

Crypto as it actually shows up — in real apps, in audit work, in bug bounty, in CTF. The goal is to recognise broken constructions on sight and run the canonical attacks without looking up the syntax.

Prereqs

  • One scripting language (Python by default; SageMath unlocks the RSA / lattice tier).
  • Comfort with modular arithmetic; basic linear algebra helps.

Stage 1 — encoding and classical

Goal: never confuse encoding with encryption again, and finish any classical-cipher artefact in minutes.

Stage 2 — symmetric (the real-world bug surface)

Goal: spot mode misuse and weak-keystream patterns in real apps; run the canonical attacks against a target without looking it up.

Stage 3 — asymmetric

Goal: recognise the standard RSA breakages by parameter shape; tell when DH is broken without writing a solver.

Stage 4 — applied / protocol-level

Where crypto-shaped bugs actually live in modern systems.

  • hash-length-extension — query-string signing schemes.
  • shamir-threshold — distributed secret recovery.
  • Elliptic curves — point arithmetic; ECDLP-hard vs anomalous curves.
  • TLS misconfig, cookie signing schemes, S3 pre-signed URL parsing.

Why this matters outside CTF

  • Bug-bounty programs pay for token-format bugs (IDOR-via-JWT, predictable session tokens, signed-URL forgery).
  • Audit work routinely flags ECB cookies, hardcoded IVs, predictable password-reset tokens.
  • Production incidents land on weak randomness, mode misuse, and signature-scheme confusion more often than on broken primitives.

References

  • CryptoHack — best free hands-on.
  • CryptoPals — the canonical exercises.
  • Cryptography Engineering (Ferguson, Schneier, Kohno) for grounding.
  • Serious Cryptography (Aumasson) for modern depth.
  • Handbook for CTFers (Nu1L Team, Springer) — structural source for the symmetric and RSA topic coverage.