This is a Python implementation of the Caesar Cipher, a simple encryption technique that shifts each letter in the plaintext by a specified number of places. The program supports both encryption and decryption of messages.
- Encryption: Shifts each letter in the text by a specified shift value to create an encrypted message.
- Decryption: Reverses the shift to retrieve the original message.
- Handles both uppercase and lowercase letters.
- Leaves non-alphabetic characters unchanged.
- The program uses the ASCII values of characters to calculate the shifted positions.
- Uppercase and lowercase letters are handled separately to maintain case sensitivity.
- Non-alphabetic characters (e.g., numbers, spaces, punctuation) remain unaltered.
- Python 3.x installed on your system.
- Clone the repository (if applicable):
git clone https://github.com/tholumuzikhuboni/PRODIGY_CY_01.git cd PRODIGY_CV_01
- Run the script:
python caesar-cipher.py
- Follow the on-screen instructions:
- Choose whether to encrypt or decrypt a message.
- Enter the message to process.
- Enter a shift value (integer).
Input:
- Operation:
encrypt
- Message:
Hello, World!
- Shift:
3
Output:
Encrypted message: Khoor, Zruog!
Input:
- Operation:
decrypt
- Message:
Khoor, Zruog!
- Shift:
3
Output:
Decrypted message: Hello, World!