Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 885 Bytes

File metadata and controls

39 lines (26 loc) · 885 Bytes

Caesar Cipher in Python

A simple command-line implementation of the Caesar cipher for basic text encryption and decryption, written in Python.

Features

  • Encrypts messages using a specified shift key.
  • Decrypts messages using the same shift key.
  • Handles both uppercase and lowercase letters.
  • Preserves spaces, numbers, and punctuation.

How to Run

  1. Make sure you have Python 3 installed.

  2. Clone this repository or download the CaesarCipher.py file.

  3. Open your terminal or command prompt.

  4. Navigate to the directory where CaesarCipher.py is located.

  5. Run the script with the following command:

    python CaesarCipher.py

Example Usage

--- Caesar Cipher Program ---

Choose an option:

Encrypt

Decrypt

Exit

1 Enter the message to encrypt: Hello, World! Enter the shift key (a number): 3

Ciphertext: Khoor, Zruog!