diff --git a/Python Projects/Ceaser Cipher/README.md b/Python Projects/Ceaser Cipher/README.md index 5f2deb6526..804a2a72ff 100644 --- a/Python Projects/Ceaser Cipher/README.md +++ b/Python Projects/Ceaser Cipher/README.md @@ -1,33 +1,70 @@ -# Caesar Cipher Encryption and Decryption +# 🔐 Caesar Cipher Encryption and Decryption -This Python code implements a simple Caesar Cipher encryption and decryption program. The Caesar Cipher is a substitution cipher in which each letter in the plaintext is shifted a certain number of positions down the alphabet. +Welcome to the Caesar Cipher project! This is a great introduction to cryptography and Python programming. Whether you're just starting your coding journey or looking to understand classical ciphers, this project is perfect for you. 🚀 -## How it works +## What is a Caesar Cipher? 🤔 -The code consists of the following functions: +The Caesar Cipher is one of the simplest and most well-known encryption techniques! It's a substitution cipher where each letter in your message is shifted by a fixed number of positions in the alphabet. Named after Julius Caesar, who used it to protect his military communications, it's a fantastic way to learn about encryption basics. -1. `getDoubleAlphabet(alphabet)`: This function takes an `alphabet` (a string containing all the letters of the alphabet) as input and returns a new string containing the `alphabet` repeated twice. This is used to handle wrapping around the end of the alphabet during encryption and decryption. +**Example:** +- Original message: "HELLO" +- With a shift of 3: "KHOOR" +- A → D, B → E, C → F, and so on! -2. `getMessage()`: This function prompts the user to input a message to encrypt and returns the entered message as a string. +## 🔧 How it Works -3. `getCipherKey()`: This function prompts the user to enter a key (a whole number from 1 to 25) for encryption and returns the entered key as an integer. +Our program uses several Python functions that work together like a well-oiled machine: -4. `encryptMessage(message, cipherKey, alphabet)`: This function takes a `message`, a `cipherKey`, and the `alphabet` as inputs and performs Caesar Cipher encryption on the message. It returns the encrypted message as a string. +### Core Functions: +• **`getDoubleAlphabet(alphabet)`** - Creates a doubled alphabet string to handle letter wrapping +• **`getMessage()`** - Gets your secret message from user input +• **`getCipherKey()`** - Gets your encryption key (1-25) from user input +• **`encryptMessage(message, cipherKey, alphabet)`** - Transforms your message into encrypted text +• **`decryptMessage(message, cipherKey, alphabet)`** - Converts encrypted text back to readable message +• **`runCaesarCipherProgram()`** - Runs the complete program workflow -5. `decryptMessage(message, cipherKey, alphabet)`: This function takes an `encryptedMessage`, a `cipherKey`, and the `alphabet` as inputs and performs decryption using the same key but in reverse. It returns the decrypted message as a string. +## 🚀 How to Use -6. `runCaesarCipherProgram()`: This function runs the entire Caesar Cipher program. It initializes the `myAlphabet` variable with the uppercase alphabet, gets the double alphabet using `getDoubleAlphabet`, prompts the user for a message and cipher key, performs encryption and decryption, and prints the results. +Getting started is super easy! Just follow these simple steps: -## How to use +### Step 1: Setup +• Clone or download the `encrypt_message.py` file +• Make sure you have Python installed on your computer -1. Clone or download the Python file and save it as `encrypt_message.py`. +### Step 2: Run the Program +• Open your terminal/command prompt +• Navigate to the project folder +• Run: `python encrypt_message.py` -2. Run the code in a Python environment. +### Step 3: Encrypt Your Message +• Enter the message you want to encrypt +• Choose a cipher key (any number from 1 to 25) +• Watch the magic happen! ✨ -3. Follow the prompts to enter the message you want to encrypt and the cipher key (a number from 1 to 25). +### Step 4: See the Results +• View your encrypted message +• See the automatic decryption back to your original message -4. The program will then perform encryption and decryption on the message using the provided key and display the results. +## 💡 What You'll Learn + +- Basic encryption/decryption concepts +- String manipulation in Python +- User input handling +- Function design and organization +- ASCII character operations + +## 🎯 Perfect for Beginners! + +This project is ideal if you're: +- New to programming and want a fun project +- Learning about cybersecurity basics +- Interested in historical cryptography +- Looking to practice Python fundamentals + +## 📸 Screenshot -## Screenshot ![Screenshot](https://github.com/amelia2802/Dev-Geeks/assets/49182604/bbd2b93f-03ae-4288-8945-95e68c37114a) +--- + +**Happy coding! 🎉** Feel free to experiment with different messages and keys!