OverTheWire Bandit: Level 11 to Level 12
The Goal
The password is in data.txt but all letters have been rotated by 13 positions — ROT13. Decode it.
What I Did
I knew from the description that this was ROT13 and that tr was the right tool. What I couldn’t figure out from the tr manual was the exact syntax — the man page describes flags but gives no examples of character substitution.
After understanding how tr works, the command is:
1
2
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'
The password is GROozWPO8QyN0mGrjUkID0WCYkZiQxrN
What ROT13 Is
ROT13 stands for “rotate by 13.” Each letter is replaced by the letter 13 positions ahead of it in the alphabet. Since the alphabet has 26 letters, rotating by 13 twice brings you back to the original — ROT13 is its own inverse. Encoding and decoding use the exact same operation.
1
2
A → N → A
B → O → B
It’s not encryption — it provides no security whatsoever. It’s used to obscure text casually, like hiding spoilers in forum posts, not to protect anything sensitive.
How tr Works
tr translates characters by mapping one set to another position by position:
1
tr 'set1' 'set2'
Every character in set1 gets replaced by the character at the same position in set2.
For ROT13:
'A-Za-z'— all 52 letters, A through Z then a through z'N-ZA-Mn-za-m'— N through Z (13), then A through M (13), then n through z (13), then a through m (13)
The number 13 isn’t a parameter you pass. It’s implicit in where you start the second set. tr just maps positions — A maps to N, B maps to O, and so on until you wrap around.
Why the tr Manual Wasn’t Enough
The man page for tr explains flags but doesn’t show how character ranges work in practice. This is a common issue with Linux man pages — they’re accurate reference documentation but not tutorials. For commands like tr where the power is in how you construct the sets, examples matter more than flag descriptions.
When the man page isn’t enough, the right move is to search for examples online or ask. Understanding why the solution works after seeing it is what actually matters.
What I Learned
ROT13 is a substitution cipher, not encryption. It obscures text but provides no security. Any tool that can do character substitution can decode it instantly.
tr maps characters position by position. The power isn’t in the flags — it’s in how you construct the two sets. Learning to write ranges like 'a-z', 'n-za-m' correctly is what makes tr useful.
Man pages are reference documentation, not tutorials. They tell you what flags exist. They don’t always show you how to combine them for real tasks. Supplementing with examples is normal and necessary.
Commands Used
| Command | What it did |
|---|---|
cat data.txt | Read the ROT13 encoded content |
tr 'A-Za-z' 'N-ZA-Mn-za-m' | Mapped every letter to its ROT13 equivalent |