Skip to content

komalgoli/caesar-cipher-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Caesar Cipher Web Application

A simple and elegant web-based Caesar cipher encryption/decryption tool built with Python Flask. This application allows users to encrypt and decrypt messages using the classic Caesar cipher algorithm through an intuitive web interface.

🌟 Features

  • Encryption & Decryption: Easily encrypt or decrypt text messages
  • Web Interface: Clean, responsive design with gradient styling
  • Real-time Processing: Instant results without page refresh
  • Case Preservation: Maintains uppercase and lowercase letters
  • Non-alphabetic Support: Preserves numbers, spaces, and special characters
  • User-friendly: Simple 0-25 shift range with clear instructions

🚀 Quick Start

Prerequisites

  • Python 3.7 or higher
  • pip (Python package installer)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/caesar-cipher.git
    cd caesar-cipher
  2. Create a virtual environment (recommended):

    python -m venv venv
    # On Windows
    venv\Scripts\activate
    # On macOS/Linux
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python app.py
  5. Open your browser and navigate to:

    http://localhost:5000
    

📖 Usage

  1. Enter your message in the text area
  2. Set the shift value (0-25)
  3. Click "Encrypt" to encode your message
  4. Click "Decrypt" to decode a message
  5. View results in the output box below

Example:

  • Original: "Hello World"
  • Shift: 3
  • Encrypted: "Khoor Zruog"
  • Decrypted: "Hello World"

🛠️ Technical Details

Project Structure

caesar-cipher/
├── app.py                 # Flask web application
├── caesar.py             # Caesar cipher algorithm
├── requirements.txt      # Python dependencies
├── README.md            # This file
├── LICENSE              # MIT License
├── .gitignore           # Git ignore rules
└── templates/
    └── index.html       # Web interface

API Endpoints

  • GET / - Serve the main web interface
  • POST /process - Process encryption/decryption requests
    • Request Body: {"message": "text", "shift": number, "mode": "encrypt|decrypt"}
    • Response: {"result": "processed_text"}

Algorithm

The Caesar cipher shifts each letter in the alphabet by a fixed number of positions:

  • Encryption: (character_position + shift) % 26
  • Decryption: (character_position - shift) % 26
  • Non-alphabetic characters remain unchanged
  • Case is preserved (uppercase/lowercase)

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Improve documentation
  • Submit pull requests

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by classical cryptography techniques
  • Built with Flask web framework
  • Designed for educational purposes

📞 Support

If you encounter any issues or have questions, please open an issue on GitHub.

About

A web-based Caesar cipher encryption/decryption tool with Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors