Welcome to CipherLab! This project is a comprehensive, multi-page web application built with Streamlit, designed as an interactive and educational tool for anyone interested in the fascinating world of classical cryptography.
Whether you're a student, history enthusiast, or developer curious about encryption, CipherLab provides a hands-on platform to explore, experiment with, and understand the building blocks of secret communication.
Access the live, deployed version of the application here: CipherLabs
CipherLab is organized into four distinct modules, each designed for a specific learning objective:
- Interactive sandbox to experiment with individual classical ciphers.
- Encrypt and decrypt messages with a wide range of ciphers (Caesar, Playfair, Hill, and more).
- Detailed, step-by-step breakdown of the cryptographic process.
- Dynamically adjust keys and parameters to see effects in real-time.
- Explore the power of combining ciphers to enhance security.
- Create a "product cipher" by chaining any two ciphers in sequence.
- Understand encryption (Plaintext → Cipher1 → Cipher2 → Ciphertext) and decryption (Ciphertext → Cipher2 → Cipher1 → Plaintext) in reverse order.
- Analyze the full process trace for both encryption and decryption stages.
- A rich educational resource covering each cipher's history, methodology, and vulnerabilities.
- Examples and mathematical principles behind algorithms.
- Understand the historical context in which these ciphers were used and broken.
- Think like a codebreaker and learn to exploit classical cipher weaknesses.
- Frequency Analysis: Visualize letter frequency in any ciphertext and compare to standard English distribution.
- Index of Coincidence (IC) Calculator: Statistical tool to help determine cipher types (monoalphabetic vs. polyalphabetic).
- Frontend: Streamlit
- Backend & Logic: Python
- Data Manipulation & Visualization: Pandas, NumPy (for Hill Cipher)
CipherLab/
├── app.py # Main Streamlit app (UI logic)
├── cipher_engine.py # Backend orchestrator for all ciphers
├── cryptanalysis_logic.py # Backend logic for analytical tools
├── requirements.txt # Python dependencies
│
├── ciphers/ # Individual cipher algorithms
│ ├── __init__.py
│ └── *.py
│
└── descriptions/ # Educational content in Markdown
└── *.md
Follow these steps to run CipherLab on your local machine:
-
Clone the repository:
git clone https://github.com/CodeRafay/CipherLab.git cd CipherLab -
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
Your browser should automatically open with the application running!
Contributions are welcome and greatly appreciated! Whether it's adding a new cipher, improving the UI, or fixing a bug, your help makes this project better.
To contribute:
-
Fork the repository using the 'Fork' button in the top right.
-
Create a new branch for your feature or fix:
git checkout -b feature/YourAmazingFeature
-
Make your changes and commit with a clear message.
-
Push your changes to your forked repository.
-
Open a Pull Request to the main
CodeRafay/CipherLabrepository.
Don't forget to leave a star ⭐ if you find this project useful or interesting!
This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.