The Goal
The password for Level 12 is stored in data.txt, where all lowercase (a-z)
and uppercase (A-Z) letters have been rotated by 13 positions (ROT13).
The Approach
ROT13 shifts each letter 13 places through the alphabet. Since the alphabet has 26 letters,
applying ROT13 twice returns the original text. The tr command handles this by
mapping each letter to its rotated equivalent:
bandit11@bandit:~$ ls
data.txt
bandit11@bandit:~$ cat data.txt
[ROT13 encoded password]
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'
The password is password
The tr expression maps uppercase A-Z to N-ZA-M (i.e., A becomes N, B becomes O,
etc.) and lowercase a-z to n-za-m the same way.
Commands Covered
tr 'A-Za-z' 'N-ZA-Mn-za-m', translate characters to apply ROT13 decoding