Crypto

Tip

Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Support HackTricks

This section focuses on practical cryptography for hacking/CTFs: how to quickly recognize common patterns, pick the right tools, and apply known attacks.

If you’re here for hiding data inside files, go to the Stego section.

How to use this section

Crypto challenges reward speed: classify the primitive, identify what you control (oracle/leak/nonce reuse), then apply a known attack template.

CTF workflow

Crypto CTF Workflow

Symmetric crypto

Symmetric Crypto

Hashes, MACs, and KDFs

Hashes, MACs & KDFs

Public-key crypto

Public-Key Crypto

TLS and certificates

TLS & Certificates

Crypto in malware

Crypto in Malware

Misc

Crypto CTF Misc

Quick setup

  • Python: python3 -m venv .venv && source .venv/bin/activate
  • Libraries: pip install pycryptodome gmpy2 sympy pwntools
  • SageMath (often essential for lattice/RSA/ECC): https://www.sagemath.org/

Tip

Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)

Support HackTricks