Welcome to the Caesar Cipher (Encrypt/Decrypt) page.
This page contains a brief description and implementation instructions for the project.
Project Description
Implements a simple substitution cipher. The user provides a text message and a shift amount; the program shifts each letter by that many places in the alphabet (wrapping around) to encrypt or decrypt the message.
Project Requirements
Python 3.x (no external libraries needed).
How to Run the Project
- Create a script (e.g.
caesar_cipher.py
) that asks “Encrypt or Decrypt?”, then a shift key and message. - Run it:
python caesar_cipher.py
. Follow prompts to input key (e.g. 3) and text. The program outputs the shifted text.
Key Concepts Learned
- String Manipulation: Converting characters to ASCII codes (
ord
/chr
) and applying shifts. - Modular Arithmetic: Wrapping letters A–Z using modulo 26.
- User Input: Getting strings and numeric shift values.
- Loops: Processing each character of the string.
Possible Extensions
- Handle upper and lower case letters separately.
- Include numbers and punctuation (or skip them).
- Try other ciphers (Vigenère cipher).
- Add brute-force decryption (try all 25 shifts).