Skip to content

Commit ed9bfc3

Browse files
authored
project info has been added
1 parent c917fb1 commit ed9bfc3

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

projects/caesar-cipher/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
A simple command-line tool written in Python to perform encryption and decryption using the Caesar cipher algorithm.
2+
3+
4+
The `Caesar cipher` is one of the simplest and oldest encryption techniques. Named after `Julius Caesar`, who used it to encode his private messages, it works by shifting each letter in the message a fixed number of places down or up the alphabet.
5+
6+
## Features
7+
8+
- Encrypt messages using a Caesar cipher with a specified shift value.
9+
- Decrypt messages that were encrypted using a Caesar cipher.
10+
11+
```bash
12+
Select operation:
13+
1. Encrypt
14+
2. Decrypt
15+
3. Exit
16+
Enter choice (1-3): 1
17+
Enter text: Hello World
18+
Enter shift value: 3
19+
Encrypted text: Khoor Zruog
20+
```
21+
```bash
22+
Select operation:
23+
1. Encrypt
24+
2. Decrypt
25+
3. Exit
26+
Enter choice (1-3): 2
27+
Enter text: Khoor Zruog
28+
Enter shift value: 3
29+
Decrypted text: Hello World
30+
```
31+
32+
## How It Works
33+
34+
### Shift Value
35+
You choose a number, called the shift value or key. This number determines how many positions each letter in the message will be shifted.
36+
37+
### Encryption
38+
To encrypt a message, you shift each letter in the message forward by the shift value. For example, if the shift value is 3:
39+
40+
- The letter 'A' becomes 'D'
41+
- The letter 'B' becomes 'E'
42+
- The letter 'Z' becomes 'C' (since it wraps around from the end of the alphabet)
43+
44+
### Decryption
45+
To decrypt a message, you shift each letter backward by the same shift value. This reverses the encryption and retrieves the original message.
46+
47+
### Example
48+
**Original Message:** HELLO
49+
**Shift Value:** 3
50+
**Encrypted Message:** KHOOR
51+
52+
Here's how it works with the shift value of 3:
53+
54+
- 'H' (the 8th letter) becomes 'K' (the 11th letter)
55+
- 'E' (the 5th letter) becomes 'H' (the 8th letter)
56+
- 'L' (the 12th letter) becomes 'O' (the 15th letter)
57+
- 'O' (the 15th letter) becomes 'R' (the 18th letter)
58+
59+
### Decryption Example
60+
**Encrypted Message:** KHOOR
61+
**Shift Value:** 3
62+
**Decrypted Message:** HELLO
63+
64+
Here, each letter is shifted back by 3 positions:
65+
66+
- 'K' becomes 'H'
67+
- 'H' becomes 'E'
68+
- 'O' becomes 'L'
69+
- 'R' becomes 'O'
70+

0 commit comments

Comments
 (0)