Skip to content

joshua-spec-pixel/caesar-cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Caesar Cipher Tool

A simple Python implementation of the classic Caesar Cipher encryption and decryption algorithm. This tool allows you to encrypt or decrypt text by shifting the letters by a specified number of positions.

Features

  • Encrypt or decrypt any text using the Caesar Cipher.
  • Supports both uppercase and lowercase letters.
  • Retains non-alphabetic characters (spaces, punctuation, numbers).
  • Input validation for shift value and mode.

Usage

  1. Run the script:

    python caesar cipher.py
    
  2. Follow the prompts:

    • Enter your text to encrypt or decrypt.
    • Enter a shift value (an integer between 1 and 25).
    • Choose the mode: encrypt or decrypt.
  3. View the result:

    • The processed text will be displayed, showing the original text, shift value, mode, and result.

Example

=== Caesar Cipher Tool ===
Enter your text: Hello, World!
Enter shift value (1-25): 3
Choose mode (encrypt/decrypt): encrypt

Original text: Hello, World!
Shift: 3
Mode: encrypt
Result: Khoor, Zruog!

How It Works

  • Encryption: Each letter in the text is shifted forward by the specified value.
  • Decryption: Each letter is shifted backward by the specified value.
  • Non-alphabetic characters are left unchanged.

Functions

  • caesar_cipher(text, shift, mode='encrypt')
    Processes the text with the specified shift and mode.

  • main()
    Command-line interface for user interaction.

Requirements

  • Python 3.x

License

This project is open source. See LICENSE for details.

About

An ancient way of cryptography

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages