Caesar, but by how much?
After ROT13 the Crow changed his mind: now he shifts the letters by a number he chooses himself, from 1 to 25, and does not say which. But he has a habit that gives him away... Find the key and read the letter with the treasure code.
Lab 7 of 10 in the Encodings & secrets path. If you get stuck you have 3 hints, from the vaguest to the most precise: they cost 0, 40 and 120 XP.
What you learn
Objectives complete themselves while you work in the terminal; each one is worth experience points:
- Read the README (50 XP)
- Read the first encrypted letter (50 XP)
- Decrypt the test letter with tr (150 XP)
- Open the second letter (50 XP)
Topics: codici, cesare, tr.
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.tr: replaces characters with others: with the right rules it applies or undoes ROT13.
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:
The Caesar cipher shifts every letter by k places: with only 25 possible keys, trying them all takes a few seconds (brute force) and, if you know the beginning of the message (here "Dear"), the key can be read at a glance: it is a known-plaintext attack. More generally, a cipher with few keys, or with predictable messages, protects nothing. Defense: use a modern, well-tested encryption (AES-GCM, ChaCha20-Poly1305) with long random keys, which cannot all be tried (2^128 is too many even for all the computers in the world) and which hide the regularities of the text; never invent a cipher of your own; keep the key away from the data.
Before and after this lab
To unlock it you must have solved:
- Caesar's cipher (Encodings & secrets, medium)
It is one of the final labs: no other lab requires it.
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.