morikeli / caesar-code-breaker

This is a Python script to encrypt/decrypt a text using Caesar's cipher.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

Understanding Caesar's cipher and its inventor - Historical background

Who is Julius Caesar?

Julius Caesar (100 BCE – 44 BCE) was a Roman military and political leader who played a critical role in the events that led to the demise of the Roman Republic and the rise of the Roman Empire. He was born into a patrician family, which was the elite class in ancient Rome, and he became a prominent military general and statesman.

On the Ides of March (March 15), 44 BCE, Julius Caesar was assassinated by a group of Roman senators, including several of his close associates, in what is one of the most famous political assassinations in history. After his death, a series of civil wars followed, eventually leading to the rise of Caesar's adopted heir and grandnephew, Octavian, who later became known as Augustus, the first Roman Emperor. Caesar's life and death have been widely studied and portrayed in literature, theater, and film, making him one of the most enduring figures of ancient history.

What is Caesar's Cipher?

Caesar's Cipher, also known as the Caesar Shift or Caesar's Code, is one of the simplest and oldest methods of encryption technique. It is named after Julius Caesar, who is reputed to have used it to communicate with his generals.

In Caesar's Cipher, each letter in the plaintext (the message you want to encrypt) is shifted a fixed number of positions down or up the alphabet. For example, with a shift of 3:

- A becomes D
- B becomes E
- C becomes F
- ...
- X becomes A
- Y becomes B
- Z becomes C

The number of positions each letter is shifted is the key of the cipher. In the example above, the key is 3.

To decrypt the message, you need to shift the letters back by the same number of positions. It's a type of substitution cipher where each letter in the plaintext is 'substituted' by a letter located a fixed number of positions down or up the alphabet.

Here's an example of how the word "HELLO" would be encrypted with a Caesar Cipher and a shift of 3:

- H -> K
- E -> H
- L -> O
- L -> O
- O -> R

So, "HELLO" encrypted with a Caesar Cipher and a shift of 3 becomes "KHOOR".

About

This is a Python script to encrypt/decrypt a text using Caesar's cipher.

License:MIT License


Languages

Language:Python 100.0%