Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mostafahima/caesar-cipher-program
This program uses Caesar Cipher to encrypt or decrypt text by shifting letters based on a user-defined number interactively.
https://github.com/mostafahima/caesar-cipher-program
caesar-cipher python
Last synced: 5 days ago
JSON representation
This program uses Caesar Cipher to encrypt or decrypt text by shifting letters based on a user-defined number interactively.
- Host: GitHub
- URL: https://github.com/mostafahima/caesar-cipher-program
- Owner: MostafaHima
- Created: 2024-12-17T09:21:14.000Z (17 days ago)
- Default Branch: main
- Last Pushed: 2024-12-17T09:27:44.000Z (17 days ago)
- Last Synced: 2024-12-17T10:27:30.996Z (17 days ago)
- Topics: caesar-cipher, python
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Caesar Cipher Program
This program implements the **Caesar Cipher**, a simple encryption and decryption technique that shifts letters in the text by a given number of positions. The program allows users to encode or decode messages interactively.
## Features
- **Encryption**: Shift text letters to the right.
- **Decryption**: Shift text letters to the left.
- Handles only lowercase letters; other characters remain unchanged.
- Interactive user interface with options to encode, decode, or exit the program.
- Validates user input for shift values.## Requirements
The program uses the following Python libraries:
- `pyfiglet`: To display ASCII art for the program title.
- `string`: To process the lowercase alphabet.To install the `pyfiglet` library, run:
```bash
pip install pyfiglet
```## How to Run the Program
1. Ensure Python is installed on your system.
2. Install required dependencies.
3. Run the script:
```bash
python main.py
```## Usage
- **Step 1**: Enter the text you want to encode or decode.
- **Step 2**: Enter the shift value (an integer).
- **Step 3**: Choose one of the following options:
- `encode`: Encrypt the text.
- `decode`: Decrypt the text.
- `exit`: Exit the program.### Example
**Input**:
```
Enter the text to process: hello
Enter shift value (integer only): 3
Would you like to Encode, Decode, or Exit? (Type encode/decode/exit): encode
```
**Output**:
```
Encrypted Text: khoor
```**Decoding Example**:
```
Would you like to Encode, Decode, or Exit? (Type encode/decode/exit): decode
Decrypted Text: hello
```## Notes
- Only lowercase letters are processed.
- Non-alphabetical characters remain unchanged.
- The program runs in a loop until you choose to exit.## Program Flow
1. Displays ASCII art.
2. Prompts the user for input text and a shift value.
3. Encrypts or decrypts the text based on user choice.
4. Repeats the process until the user exits.