Bandit12
Bandit Level 12 — undo a ROT13 substitution cipher with the tr command.
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Level Goal
The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions
Commands you may need to solve this level
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
Helpful Reading Material
Study guide
Level map: logged in as bandit11, find the password for bandit12.
What this level teaches
Substitution ciphers, and character translation with tr.
Key ideas
- ROT13 replaces each letter by the one 13 places later in the alphabet, wrapping around. Because the alphabet has 26 letters, applying ROT13 twice returns the original, so the same operation encrypts and decrypts.
tr SET1 SET2replaces each character of the first set with the corresponding character of the second. Ranges such asa-eare allowed, sotr 'a-e' 'A-E'upper-cases only those five letters.- ROT13 is trivially reversible and provides obfuscation, not security.
How to approach it
- Work out by hand where
Aandaland after a 13-place shift, and write the two sets so every letter is covered. - Remember upper and lower case need their own ranges.
- Test your
trcommand on a word you encode yourself before applying it to the real file.
Why it matters
This is the first step of Krypton, where simple ciphers like this are attacked systematically with frequency analysis.