Skip to content

ShakalBhau0001/caesar-cipher-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Caesar Cipher Implementation (Python)

A simple and educational Python implementation of the Caesar Cipher encryption algorithm. This project demonstrates left and right shifting encryption and decryption using basic character manipulation and modular arithmetic.

It is created as a learning and academic project to understand how classical cryptography works internally, not as a production-ready security system.


๐Ÿงฑ Project Structure

caesar-cipher-python/
โ”‚
โ”œโ”€โ”€ assets/           # Screenshots
โ”œโ”€โ”€ app.py            # Basic CLI version
โ”œโ”€โ”€ interactive.py    # Rich-powered CLI
โ”œโ”€โ”€ requirements.txt  # Dependencies
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ README.md

โœจ Features

๐Ÿ” Left & Right Shift Support

  • User can choose:
    • L โ†’ Left Shift
    • R โ†’ Right Shift
  • Demonstrates both encryption directions for learning clarity

๐Ÿ”’ Encryption

  • Encrypts alphabetic characters using a shift key
  • Preserves uppercase and lowercase letters
  • Keeps spaces and special characters unchanged

๐Ÿ”“ Decryption

  • Automatically decrypts using the opposite shift direction
  • Verifies correctness of the algorithm

๐Ÿงฎ Educational Focus

  • Clean and readable logic
  • Uses modular arithmetic (% 26)
  • Ideal for beginners in cryptography
  • No external dependencies

๐ŸŽจ Rich CLI (Interactive Mode)

  • Beautiful colored terminal UI using Rich
  • Structured panels for output display
  • Interactive prompts with validation
  • Enhanced user experience compared to standard CLI

โšก Dual Mode Support

  • ๐Ÿงผ Basic CLI โ†’ Lightweight, no dependencies
  • ๐ŸŽจ Rich CLI โ†’ Enhanced UI with colors and panels

๐Ÿ›  Technologies Used

Technology Role
Python 3 Core programming language
ord() / chr() Character-to-ASCII conversion
Modular Arithmetic Circular alphabet shifting
Rich Styled CLI, colors, panels

๐Ÿ“Œ Purpose of This Project

This project is built to:

  • Understand classical cryptography
  • Learn Caesar Cipher encryption & decryption
  • Practice modular arithmetic concepts
  • Visualize left vs right shifting
  • Strengthen Python string manipulation skills

โš ๏ธ This project is intended strictly for learning and demonstration purposes.


โ–ถ๏ธ How to Run

1๏ธโƒฃ Clone the repository

git clone https://github.com/ShakalBhau0001/caesar-cipher-python.git

2๏ธโƒฃ Navigate to the project folder

cd caesar-cipher-python

3๏ธโƒฃ Install Dependencies

pip install rich

OR

pip install -r requirements.txt

4๏ธโƒฃ Running the Project

Basic CLI Version

python app.py

Rich Interactive Version

python interactive.py

5๏ธโƒฃ Follow the prompts for Basic CLI Version

  • Enter a message
  • Enter a shift key (integer)
  • Choose direction:
    • L for Left Shift
    • R for Right Shift
  • View encrypted and decrypted output

๐Ÿ”Ž Example

Enter message: HELLO
Enter shift key: 3
Choose direction (L = Left, R = Right): R

Encrypted Message: KHOOR
Decrypted Message: HELLO

โš ๏ธ Limitations

  • Not secure for real-world use
  • Classical cipher (easily breakable)
  • No brute-force protection
  • CLI-based interaction only

๐ŸŒŸ Future Improvements

  • Add brute-force mode
  • Add English frequency scoring
  • Add input validation for shift values
  • Add file encryption support
  • Create GUI version

โš ๏ธ Disclaimer

This implementation is created for educational and learning purposes only. The Caesar Cipher is a historically important but insecure encryption method and must not be used to protect real-world sensitive data.


๐Ÿ“ธ Preview

Rich CLI Preview


๐Ÿชช Author

Developer: Shakal Bhau

GitHub: ShakalBhau0001


โญ Support

If you like this project, consider giving it a โญ on GitHub!


About

Educational Python implementation of the Caesar Cipher with left and right shift support, demonstrating classical encryption and decryption using modular arithmetic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages