Bandit 12
Objective
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
Solution
This level has the password in data.txt but it has been encrypted with a Cesar cipher with a 13 position shift. This is also called ROT13 if you wanna google around for it.
we can read the file and pipe it into the translate command 'tr' the basic syntax is tr 'original dataset' 'translated dataset'
so to decode the syntax a bit more
The Original data set is A-Z in uppercase and a-z in lower case
but we want it to translate where the alphabet is shifted over 13 chacters so a becomes n, b becomes o..... and so on
so the translated data set is broken out to
N-ZA-M for upper case so use the alphabet in this order where the first letter of the alphabet is N and the last letter is M
and then the same thing for lowercase characters
Now in Python
import base64import codecs
Objective
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
Solution
This level has the password in data.txt but it has been encrypted with a Cesar cipher with a 13 position shift. This is also called ROT13 if you wanna google around for it.
we can read the file and pipe it into the translate command 'tr' the basic syntax is tr 'original dataset' 'translated dataset'
so to decode the syntax a bit more
The Original data set is A-Z in uppercase and a-z in lower case
but we want it to translate where the alphabet is shifted over 13 chacters so a becomes n, b becomes o..... and so on
so the translated data set is broken out to
N-ZA-M for upper case so use the alphabet in this order where the first letter of the alphabet is N and the last letter is M
and then the same thing for lowercase characters
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'The password is 5Te8Y4drgCRfCx8ugdwuEX8KFC6k2EUu
Now in Python
Comments
Post a Comment