Cryptography

Breaking or exploiting weak cryptographic implementations. Covers classical ciphers, RSA, AES, hashing, padding oracles, and more.

RSA
AES
XOR
Hashing
Padding Oracle
ECC

What is Cryptography?

Cryptography is the practice and study of techniques for secure communication in the presence of third parties called adversaries.

In terms of CTF, cryptography involves analysing, decoding, and breaking encrypted data and algorithms to uncover the flag. For example, this is a common type of challenge:

“The flag is hidden in this Base64 string: ZmxhZ3tzYWx0eV9oYXNoYnJvd259”

A visual joke illustrating salting a hash
Salting a Hash. Image credit: Programmer Humor

Beginner’s Guide to Cryptography

Here are some essential tips to help you get started:

Identify the Cipher

Is it a classical cipher like Caesar, a modern one like RSA, or just an encoding like Base64? Knowing what you’re up against is the first step.

Look for Weaknesses

Challenges often have a flaw. Is the RSA key too small? Is the same key used twice (a key reuse attack)? Is there a way to leak part of the key?

Use the Right Tools

Don’t reinvent the wheel. Tools like CyberChef can decode common formats in seconds. For more complex tasks, a scripting language with a good crypto library (like Python with PyCryptodome) is your best friend.

Resources & Tools