Peel the Encoding: Decoding Layered Base64 and ROT13

Cryptography Level 1/5 ~60 sec 2026-06-19

The challenge

This string went through two layers before it landed in a log. Peel them off with the decoder buttons until the flag falls out, then submit it. Flags look like HDNA{...}.

What you'll learn

  • Understand the difference between encoding and encryption and why encoding offers no confidentiality
  • Recognise base64 by sight (its character set and trailing = padding) before decoding
  • Spot a ROT13 / Caesar shift in text where the word shape is intact but the letters are wrong
  • Peel chained transforms one layer at a time and confirm when you have reached readable plaintext
  • Rule out decoy transforms (hex, URL, reverse) by checking whether their input format even applies

Skills tested

Base64 recognition and decodingROT13 / Caesar shift reversalLayer identification across chained encodings

Prerequisites

  • Familiarity with the idea that data can be re-represented (encoded) without being secret
  • Basic comfort reading short ASCII strings

How it works

Encoding and encryption are easy to confuse because both turn readable text into something that looks scrambled. The difference is the key. Encryption needs a secret to reverse it, so without the key the data stays confidential. Encoding has no key at all - it is just an agreed, public way to re-represent bytes so they survive a log file, a URL, or an email. base64 and ROT13 are encodings, not ciphers: anyone can reverse them with a single click and no secret.

That is exactly why a value hidden behind one or more encoding layers is, for security purposes, in the clear. This challenge stacks two of them. The character set and the trailing == padding give away that the outer layer is base64. Decode it and you do not get readable words yet - you get text where the word and bracket shapes look right but the letters are off by a fixed amount. That fixed letter shift is the signature of ROT13 (a Caesar shift of 13). Reverse that second layer and the plaintext flag falls out.

The decoder also offers hex, URL, and reverse buttons. These are decoys whose job is to teach layer recognition: hex decoding expects pairs of 0-9a-f digits, URL decoding expects % escapes, and reverse just flips the order. None of those formats match what you are looking at, so applying them either errors out or produces nonsense - a useful signal that you have picked the wrong tool for that layer.

Common mistakes

  • Treating encoding as encryption. Assuming the value is "protected" because it looks scrambled. There is no key here, so it offers zero confidentiality - it only takes the right buttons in the right order.
  • Guessing transforms instead of reading the format. Reaching for hex, URL, or reverse when the string clearly carries base64 padding. Each transform expects a specific input shape; check the shape before clicking.
  • Stopping after the first layer. The base64 result is still scrambled (shifted letters), so it is tempting to think you are done or that you decoded wrong. Recognise the Caesar shift and peel the second layer.
  • Re-applying a transform to its own output. Base64-decoding an already-decoded value, or ROT13-ing twice, undoes your progress. Apply each layer once, in order, and watch the output get more readable each time.

How to defend against it

The defensive takeaway is simple: never rely on encoding to keep anything secret. If a value must be confidential - a token, a session identifier, a piece of personal data - it has to be protected with real cryptography (authenticated encryption with a properly managed key) or simply not logged in the first place. base64 in a log, a cookie, or a URL parameter signals "this is a transport format", not "this is secured".

  • Keep secrets out of logs and URLs entirely; redact or hash them before they are written.
  • Use authenticated encryption (with a managed key) when data genuinely needs confidentiality, and treat any base64/hex/URL layer as cosmetic.
  • When reviewing your own systems, decode every encoded value you find to confirm nothing sensitive is sitting one click away from plaintext.

Full solution

Pro and Max members unlock the complete step-by-step walkthrough.

Go Pro

Community stats

43 completions
84% success rate
Varythor First blood
13,000+ Hackers 100+ Labs & Courses Free
Start Hacking Free