Encoding vs Encryption
Base64 and hex hide nothing. Recognising an encoding for what it is comes before any real analysis.
Workshop 02 · Cryptography
Encoding versus encryption, classical ciphers, and why key handling matters more than the algorithm. Learn where cryptography fails in practice.
Each challenge targets a different misunderstanding about what cryptography does and what it does not.
Base64 and hex hide nothing. Recognising an encoding for what it is comes before any real analysis.
Substitution and shift ciphers that fall to frequency analysis or a few minutes of brute force.
Reused keys, short keys, and unsalted hashes — strong algorithms undone by how they were used.
Lesson 1 · CRY-01
Encoding changes how data is represented so it can travel safely, for example as plain text in an email or a URL. Encryption hides data so only someone with the key can read it. Encoding has no key: anyone can reverse it.
Mistaking one for the other is a classic cryptographic failure, number two in the OWASP Top 10 (2021).
Base64 turns bytes into letters, digits, + and /. Output whose length is not a multiple of three bytes is padded with one or two = signs, a tell-tale sign of Base64. Every browser console reverses it with atob().
"hello" → Base64 → aGVsbG8= "aGVsbG8=" → atob() → hello (no key needed)
Lesson 2 · CRY-02
A Caesar cipher shifts every letter a fixed number of places through the alphabet. The Roman historian Suetonius records Julius Caesar using a shift of three. It hides a message from a casual glance, but nothing more.
There are only 25 useful shifts, so an attacker can simply try them all, which is a brute-force attack on a tiny key space. A second method is frequency analysis: in English, E is the most common letter, so the most common letter in the ciphertext is probably E.
Plaintext: HELLO WORLD Shift 3: KHOOR ZRUOG Word lengths and punctuation survive, which helps the attacker.
Lesson 3 · CRY-03
XOR-based encryption combines each byte of the message with a byte of the key. With a truly random key that is as long as the message and used only once (a one-time pad), it is unbreakable. Reuse the key and it collapses.
If two messages are encrypted with the same key, XOR-ing the two ciphertexts cancels the key out, leaving the two plaintexts combined. Knowing or guessing part of one message (a known plaintext, such as a standard greeting) then reveals the matching part of the other.
C1 = P1 ⊕ K C2 = P2 ⊕ K C1 ⊕ C2 = P1 ⊕ P2 (the key K is gone)
Lesson 4
Passwords should not be encrypted (which can be reversed) but hashed: turned into a fixed-length fingerprint that cannot be turned back. To log in, the system hashes what you type and compares fingerprints.
Plain fast hashes are not enough. Without a salt (a random value added to each password before hashing), identical passwords produce identical hashes, so one precomputed table cracks them all. Fast hashes also let attackers test billions of guesses per second, which is why password storage uses deliberately slow algorithms such as bcrypt, scrypt, or Argon2.
SHA-1("password1") → same hash for every user (crackable by lookup)
bcrypt("password1", salt) → different for every user, slow to guess
Cryptographic failures in practice are almost never broken maths — they are broken usage.
Encryption gives confidentiality, hashing gives integrity, signatures give authenticity. They are not interchangeable.
Use reviewed libraries and current standards such as AES-GCM and SHA-256 rather than a scheme you invented.
The algorithm is public by design. All the protection lives in the key, so how it is generated, stored, and rotated is the security.
Unsalted fast hashes fall to rainbow tables. Password storage needs a slow, salted function such as bcrypt or Argon2.
Try the Cryptography challenges: capture the flags, score points, and unlock the explanation for each one.