https://github.com/darshan-kc/python-caesar-cipher
A substitution cipher that shifts letters by a fixed number of positions
https://github.com/darshan-kc/python-caesar-cipher
cryptography python3
Last synced: about 1 year ago
JSON representation
A substitution cipher that shifts letters by a fixed number of positions
- Host: GitHub
- URL: https://github.com/darshan-kc/python-caesar-cipher
- Owner: Darshan-KC
- Created: 2024-11-20T15:16:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-28T15:32:21.000Z (about 1 year ago)
- Last Synced: 2025-03-28T16:34:07.212Z (about 1 year ago)
- Topics: cryptography, python3
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Caesar Cipher
This repository contains a simple implementation of the Caesar Cipher algorithm in Python. The Caesar Cipher is a classic encryption technique where each letter in the plaintext is shifted by a fixed number of positions in the alphabet.
## Features
- Encrypt a plaintext message using a shift key.
- Decrypt a ciphertext message using a shift key.
- Handles both uppercase and lowercase letters.
- Ignores non-alphabetic characters during encryption/decryption.
## How It Works
The Caesar Cipher shifts each letter in the message by a specified number of positions. For example, with a shift of `3`:
- `A` becomes `D`
- `B` becomes `E`
- `Z` wraps around to `C`
## Usage
### Prerequisites
- Python 3.x installed on your system.
### Running the Script
1. Clone the repository:
```bash
git clone https://github.com/Darshan-KC/Python-Caesar-cipher.git
cd Python-Caesar-cipher
```
2. Run the script:
```bash
python caesar_cipher.py
```
3. Follow the on-screen prompts to:
- Choose between encryption and decryption.
- Input the message and shift key.
### Example
**Input:**
- Operation: Encrypt
- Message: `Hello, World!`
- Shift Key: `3`
**Output:**
- Encrypted Message: `Khoor, Zruog!`
## File Structure
- `caesar_cipher.py`: The main script implementing the Caesar Cipher.
## Contributing
Contributions are welcome! If you find bugs or want to enhance the functionality, feel free to fork the repository and submit a pull request.
## License
This project is licensed under the [MIT License](LICENSE).
---
Happy coding! 😊