Skip to content

Latest commit

 

History

History
236 lines (170 loc) · 13.7 KB

File metadata and controls

236 lines (170 loc) · 13.7 KB

Cryptography Algorithm Toolkit banner

Cryptography Algorithm Toolkit

A comprehensive, modular, and interactive Python CLI toolkit for exploring, understanding, and experimenting with 80+ cryptographic algorithms and protocols.

Python Version Algorithms License: MIT GitHub Stars GitHub Issues Educational Tool


Warning

Educational and Experimental Disclaimer

This project is strictly designed for educational, research, and self-learning purposes. It has not undergone formal cryptographic security auditing and must NOT be used in production environments or to protect sensitive real-world data. Implementations may lack constant-time guarantees, making them susceptible to timing and side-channel vulnerabilities. For production deployments, always rely on battle-tested cryptographic libraries such as libsodium, cryptography, or Google's Tink.


📑 Table of Contents


💡 Overview

The Cryptography Algorithm Toolkit provides a single, unified command-line platform to explore cryptographic concepts spanning centuries—from classical pen-and-paper ciphers to modern authenticated encryption and cutting-edge post-quantum cryptography.

Whether you are studying how AES rounds work under the hood, tracing an RSA key generation handshake, experimenting with zero-knowledge proofs, or analyzing lattice-based post-quantum key encapsulation mechanisms, this toolkit provides runnable code, transparent step-by-step breakdowns, and dedicated documentation for each algorithm family.


✨ Key Features

  • 🎓 80+ Algorithms Across 9 Disciplines: Spans symmetric ciphers, public-key algorithms, hashing, MACs, AEAD, post-quantum schemes, advanced privacy-preserving cryptography, protocols, and historical systems.
  • 💻 Interactive & Robust CLI: Intuitive terminal UI with cross-platform screen management, input validation, and resilient error recovery.
  • 🔍 Built-in Diagnostics (D): Instantly test all 80 registered modules for missing dependencies, syntax validity, and import integrity.
  • 🧩 Modular Architecture: Cleanly isolated directories per topic with dedicated READMEs, standard interfaces, and standalone execution support.
  • 🔬 Inspect Intermediate States: Trace mathematical workings, S-Box substitutions, polynomial operations, key schedules, and network protocol handshakes.
  • 📜 Historical & Pedagogical Context: Includes broken and deprecated algorithms (e.g., DES, RC4, MD5) alongside modern counterparts to teach cryptographic evolution and vulnerability analysis.

📚 Algorithm Coverage Matrix

Category Topics & Algorithms Modules & Documentation
🔐 Symmetric Key Cryptography Block Ciphers: AES (128/192/256), DES, 3DES, Blowfish, Twofish, Camellia, CAST-128, IDEA, RC2, RC5, RC6, SEED, ARIA, Serpent, SM4, Magma, Kuznyechik
Block Modes: ECB, CBC, CFB, OFB, CTR, XTS
Stream Ciphers: ChaCha20, Salsa20, RC4, HC-128, Rabbit, SOSEMANUK, A5/1
• Block Ciphers
• Block Cipher Modes
• Stream Ciphers
🔑 Asymmetric Key Cryptography Public Key Encryption: RSA, ElGamal, Paillier, Rabin
Key Exchange: Diffie-Hellman (DH), ECDH, X25519, MQV
Elliptic Curves: ECDSA, Ed25519, Ed448, Curve25519, SM2
Digital Signatures: DSA, ECDSA, Schnorr, BLS
• Public Key Encryption
• Key Exchange
• Elliptic Curve Cryptography
• Digital Signatures
🏷️ Hash Functions MD5, SHA-1, SHA-2 (SHA-224, SHA-256, SHA-384, SHA-512), SHA-3 (Keccak), BLAKE2, BLAKE3, RIPEMD-160, Whirlpool, Tiger • Hash Algorithms
🛡️ Message Authentication (MAC) HMAC (with SHA-256 / SHA-3), CMAC, GMAC, Poly1305 • MAC Algorithms
⚡ Authenticated Encryption (AEAD) AES-GCM, AES-CCM, ChaCha20-Poly1305, AES-OCB • AEAD Schemes
⚛️ Post-Quantum Cryptography (PQC) KEMs & Encryption: CRYSTALS-Kyber (ML-KEM), NTRU, Classic McEliece, FrodoKEM
Signatures: CRYSTALS-Dilithium (ML-DSA), Falcon, SPHINCS+ (SLH-DSA)
• PQC KEMs
• PQC Signatures
🔮 Advanced Cryptography Homomorphic Encryption: Paillier additive, BFV / CKKS concepts
Secret Sharing: Shamir's Secret Sharing (SSSS), Blakley
Secure Computation: Yao's Garbled Circuits, GMW, Oblivious Transfer
Zero-Knowledge Proofs: Schnorr ZKP, Sigma protocols, zk-SNARKs overview
• Homomorphic Encryption
• Secret Sharing
• Secure Computation
• Zero-Knowledge Proofs
🌐 Cryptographic Protocols TLS 1.3 Handshake simulation, SSH-2 Key Exchange, IPsec IKEv2 flow, PGP / OpenPGP Hybrid Encryption, Kerberos Authentication • Secure Protocols
📜 Classical & Historical Ciphers Caesar Cipher, Vigenère Cipher, Playfair Cipher, Hill Cipher (Matrix), Enigma Machine Simulation • Traditional Ciphers

🚀 Getting Started

Prerequisites

  • Python 3.10 or higher (Python 3.11+ recommended)
  • Git installed on your machine
  • (Optional) C/C++ compiler tools (e.g. GCC/Clang or MSVC) if building optional native extensions like twofish, tiger, or whirlpool.

Installation & Setup

  1. Clone the repository:

    git clone https://github.com/Aakash02A/Cryptography-Algorithm.git
    cd Cryptography-Algorithm
  2. Create and activate a virtual environment:

    Windows (PowerShell)
    python -m venv .venv
    .venv\Scripts\Activate.ps1
    macOS / Linux (Bash / Zsh)
    python3 -m venv .venv
    source .venv/bin/activate
  3. Install core dependencies:

    pip install --upgrade pip
    pip install -r requirements.txt

Launching the CLI

Start the interactive terminal interface:

python main.py

Running with Docker

Docker provides a consistent Python environment on Windows, macOS, and Linux. Docker Desktop or Docker Engine with Compose is required.

Build and start the interactive toolkit:

docker compose run --rm crypto-toolkit

The equivalent Docker commands are:

docker build -t cryptography-algorithm-toolkit .
docker run --rm -it cryptography-algorithm-toolkit

Use Q to exit the toolkit and remove the temporary container.


⌨️ CLI Navigation & Shortcuts

When running main.py, you can quickly jump between sections or execute utilities using these commands:

Command Action Description
1 – 9 Select Category Navigate directly to one of the 9 cryptographic categories
D / DIAG Run Diagnostics Validates all 80 registered modules and verifies dependencies
S / SETUP Setup Guide Inspects package configuration and regenerates missing package markers
H / HELP Command Help Displays a summary of all interactive commands and shortcuts
CLS / CLEAR Clear Screen Clears the terminal output and re-renders the banner
M / MAIN Main Menu Returns to the top-level main selection screen
Q / QUIT Exit Gracefully closes the toolkit

📁 Repository Architecture

Cryptography-Algorithm/
├── assets/                               # Media, banners, and diagrams
├── Modules/                              # Modular cryptographic implementations
│   ├── Advanced_Cryptography/            # Homomorphic, ZKP, MPC, Secret Sharing
│   ├── Asymmetric_Key_Cryptography/      # Public-key ciphers, Signatures, ECC, Key Exchange
│   ├── Authenticated_Encryption_AEAD/    # GCM, CCM, ChaCha20-Poly1305, OCB
│   ├── Classical_or_Historical_Ciphers/  # Caesar, Vigenère, Playfair, Hill, Enigma
│   ├── Cryptographic_Hash_Functions/     # MD5, SHA families, BLAKE, RIPEMD, Whirlpool
│   ├── Cryptographic_Protocols/          # TLS 1.3, SSH, IPsec, PGP, Kerberos simulations
│   ├── Message_Authentication/           # HMAC, CMAC, GMAC, Poly1305
│   ├── Post_Quantum_Cryptography/        # Kyber, Dilithium, Falcon, SPHINCS+, McEliece
│   └── Symmetric_Key_Cryptography/       # Block ciphers, block modes, stream ciphers
├── samples/                              # Reference test outputs, test vectors, and keys
├── V1/                                   # Original first version — AES, RSA, SHA-256, XOR cipher
├── CONTRIBUTING.md                       # Contribution guidelines & coding conventions
├── DEVELOPMENT.md                        # Architecture details & module authoring guide
├── LICENSE                               # MIT License
├── Method-IOBehavior.md                  # I/O standards & interactive formatting conventions
├── README.md                             # Main documentation entry point
├── SECURITY.md                           # Security policy and vulnerability disclosure
├── main.py                               # Central CLI router and dispatcher
└── requirements.txt                      # Project dependencies

📖 Documentation & References


🤝 Contributing

Contributions that enrich educational clarity, add standard test vectors, implement missing algorithms, or improve documentation are very welcome!

  1. Fork the repository and create a feature branch (git checkout -b feature/new-cipher).
  2. Implement your module following the template in DEVELOPMENT.md.
  3. Include RFC/NIST test vectors or known-answer tests where possible.
  4. Run diagnostics (python main.py -> D) to confirm module integrity.
  5. Submit a descriptive Pull Request.

Please review CONTRIBUTING.md and CODE_OF_CONDUCT.md before submitting.


🛡️ Security Policy

This repository is maintained for educational and reference purposes. Please report any potential security oversights or inaccuracies by following our Security Policy.


⚖️ License

Distributed under the MIT License. See LICENSE for complete terms.

Designed and developed for cryptography education, research, and technical exploration.
Built by Aakash