This little sample of code was based on Codenation's first challenge. You can find the full original description of it in other repositories like this one.
According to dCode:
Rot-N/Rot cipher is a simple character substitution based on a shift/rotation of N letters in an alphabet. E.g. one letter is replaced by another (always the same) that is located further (exactly N letters further) in the alphabet.
This is the basis of the famous Caesar code and its many variants modifying the shift. The most popular variant is the ROT13 which has the advantage of being reversible with our 26 letters alphabet (the encryption or decryption operations are identical because 13 is half of 26).
Original Message: Tonight on 'Is There?' we examine the question, 'Is there a life after death?' And here to discuss it are three dead people.
Encoded Message: wrqljkw rq 'lv wkhuh?' zh hadplqh wkh txhvwlrq, 'lv wkhuh d olih diwhu ghdwk?' dqg khuh wr glvfxvv lw duh wkuhh ghdg shrsoh.
Notes about the script
- Python version 3.6.
- Requires requests to request and submit the
answer.json
file. - All letters are going to be converted to lowercase.
- Numbers and ponctuation remain the same.
Show detailed instructions
- Run
coder_decoder.py
with the optioncode
or the optiondecode
and the message (between quotes).
foo@bar:~$ python3 coder_decoder.py decode "bqa jcb i akzibkp."
- The default number of rotations is 3 (Caesar code), but you can set another number with the option
-r
.
foo@bar:~$ python3 coder_decoder.py decode "bqa jcb i akzibkp." -r 8
- Get your encoded or decoded message:
tis but a scratch.
Set your token, and run ./main.py
.
Show detailed instructions
- In the
main.py
file, past your token:
token = 'MYTOKEN123' #PAST your token here
- Run the
main.py
file:
foo@bar:~$ python3 main.py
- Receive your score:
OK: {score: 100}