Skip to content

Vitor-Felix/caesar-code-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caesar Code

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.

About ROT-N cipher

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.

Usage

Using only ROT-N Coder/Decoder

Show detailed instructions
  1. Run coder_decoder.py with the option code or the option decode and the message (between quotes).
foo@bar:~$ python3 coder_decoder.py decode "bqa jcb i akzibkp."
  1. 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
  1. Get your encoded or decoded message:
tis but a scratch.

Submitting the Challenge Answer

Set your token, and run ./main.py.

Show detailed instructions
  1. In the main.py file, past your token:
token = 'MYTOKEN123' #PAST your token here
  1. Run the main.py file:
foo@bar:~$ python3 main.py
  1. Receive your score:
OK: {score: 100}

About

Codenation's Admission Challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages