Skip to content
PURPLEDUEL

Layer upon layer

Encodings & secrets · medium level · 5 objectives · 600 XP in total

The Crow sealed his message like an onion: several encodings, one on top of the other. One command is not enough: chain several with the pipe and peel off the layers in the right order.

Lab 5 of 6 in the Encodings & secrets path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 50 and 150 XP.

What you learn

Objectives complete themselves while you work in the terminal; each one is worth experience points:

  • Read the Crow's recipe (50 XP)
  • Remove the base64 layer (100 XP)
  • Flip the mirror layer with rev (100 XP)
  • Turn the hexadecimal back into text (100 XP)

Topics: codici, pipe, base64, hex.

Commands you will use

The terminal is simulated and understands about forty Linux commands. In this lab you will mostly need these:

  • cat: prints the contents of a file: the most direct way to read configurations, notes and logs.
  • base64: encodes and decodes Base64, the format that turns bytes into text. It protects nothing: it can be undone without a key.
  • rev: reverses each line character by character, like a mirror.
  • xxd: shows a file in hexadecimal and can also turn hexadecimal back into text.
  • |: the vertical bar | chains commands: the output of the first becomes the input of the next, so small tools form a complete analysis.

The simulated environment

You work in a simulated Linux shell, in the home folder of the user runner: invented files and folders, no network target.

The defensive lesson

Once the lab is solved, the write-up explains what went wrong and how to protect yourself:

Stacking encodings creates no security: every layer is public and reversible, and a pipeline of three commands removes them all. Hiding under several disguises (security through obscurity) only slows down people in a hurry. Real defences are different: encryption with a secret key (AES-GCM, ChaCha20) and, for passwords, slow salted hashes (bcrypt, scrypt, Argon2). Whoever analyses suspicious data does the reverse job: recognises the format by its look (base64, hexadecimal, ROT13) and peels it off in a chain.

Before and after this lab

To unlock it you must have solved:

After this lab you can move on to:

The Encodings & secrets path

Encodings & secrets teaches a distinction that saves a lot of data: encoding is not encrypting. Base64, hexadecimal, ROT13 and mirrored text change how information looks but do not protect it, because anyone can turn it back into plain text without a key. In the labs you recognise these formats by their look, peel them off one layer at a time even when they are stacked, extract readable text from a compiled program and understand why real protection needs real encryption, salted hashes and a secrets manager.

All labs in the Encodings & secrets path

Learn more with the guides

All guides