This project is a simple implementation of the Caesar Cipher in Python. The Caesar Cipher is a basic encryption technique where each letter in the plaintext is shifted by a fixed number of positions in the alphabet.
- Encrypt and decrypt text using the Caesar Cipher method.
- Handles both uppercase and lowercase letters.
- Keeps non-alphabetic characters (spaces, punctuation, numbers) unchanged.
-
Run the script:
-
Enter the plaintext you want to encrypt/decrypt when prompted.
-
Enter the key (an integer, 1-25) for the letter shift.
-
The program will display:
- The original text
- The encrypted (cipher) text
- The decrypted (original) text
Enter the text: Hello World! Enter the key: 3 Original Text: Hello World! Encrypted Text: Khoor Zruog! Decrypted Text: Hello World!
- The program defines a function
caesar_cipher(text, key_value, mode)that shifts each alphabetic character by the key value. - For decryption, the shift is reversed.
- Non-alphabet characters are not changed.
- Uses ASCII values to shift and wrap around the alphabet.
- text_encryption.py: Main Python script containing the Caesar Cipher implementation and usage instructions.
This project is licensed under the MIT License.