Skip to content

Latest commit

ย 

History

116 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

  • ๐Ÿ› ๏ธ Development Guide: Module boilerplate template, coding patterns, and internal architecture.
  • ๐Ÿ“ Method & I/O Behavior: Standards for input parsing, hex/byte serialization, and CLI styling.
  • ๐Ÿค Contribution Guidelines: How to propose additions, submit PRs, and format cryptographic tests.
  • ๐Ÿ”’ Security Policy: Scope of educational research and vulnerability reporting procedure.
  • ๐Ÿ”‘ Sample Outputs & Test Vectors: Known-answer test samples and cryptographic intermediate values.
  • ๐Ÿ“ฆ V1 โ€” First Version: The original beginner implementation (AES, RSA, SHA-256, custom XOR cipher) preserved as a milestone.

๐Ÿค 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

About

Educational Python cryptography toolkit with implementations and demos for symmetric, asymmetric, hash, MAC, AEAD, post-quantum, and advanced cryptographic algorithms.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages