Skip to main content

Educational cipher toolbox for encryption and decryption

Project description

Cipher Toolbox

A comprehensive educational cipher toolbox for encryption and decryption, featuring both classical and modern cryptographic algorithms.

Features

Classical Ciphers

Substitution Ciphers:

  • Caesar Cipher: Simple shift cipher
  • Atbash Cipher: Alphabet reversal cipher
  • Affine Cipher: Mathematical substitution cipher

Polyalphabetic Ciphers:

  • Vigenère Cipher: Keyword-based polyalphabetic substitution
  • Autokey Cipher: Uses plaintext as part of the key
  • Beaufort Cipher: Variant of Vigenère cipher

Transposition Ciphers:

  • Rail Fence Cipher: Zigzag pattern transposition
  • Columnar Transposition: Column-based rearrangement

Modern Ciphers

Symmetric Ciphers:

  • XOR Cipher: Simple bitwise XOR encryption
  • AES: Advanced Encryption Standard (256-bit)
  • ChaCha20: Modern stream cipher

Asymmetric Ciphers:

  • RSA: Public-key cryptography

Installation

# Clone the repository
git clone https://github.com/Gabriel-Dakinah-Vincent/cipher-toolbox.git
cd cipher-toolbox

# Install dependencies
pip install cryptography

# Install the package
pip install -e .

Usage

Python API

from cipher_tool import encrypt, decrypt

# Caesar cipher
ciphertext = encrypt("caesar", "HELLO WORLD", shift=3)
plaintext = decrypt("caesar", ciphertext, shift=3)

# Vigenère cipher
ciphertext = encrypt("vigenere", "HELLO WORLD", key="SECRET")
plaintext = decrypt("vigenere", ciphertext, key="SECRET")

# AES encryption
ciphertext = encrypt("aes", "Hello World", key="mypassword")
plaintext = decrypt("aes", ciphertext, key="mypassword")

Command Line Interface

# List available ciphers
python cli.py list

# Encrypt with Caesar cipher
python cli.py encrypt caesar "HELLO WORLD" --shift 3

# Decrypt with Caesar cipher
python cli.py decrypt caesar "KHOOR ZRUOG" --shift 3

# Encrypt with Vigenère cipher
python cli.py encrypt vigenere "HELLO WORLD" --key SECRET

# Encrypt with AES
python cli.py encrypt aes "Hello World" --key mypassword

Cipher Parameters

Cipher Parameters Example
caesar shift (int) shift=3
atbash None -
affine a (int), b (int) a=5, b=8
vigenere key (str) key="SECRET"
autokey key (str) key="KEY"
beaufort key (str) key="KEY"
railfence rails (int) rails=3
columnar key (str) key="KEY"
xor key (str) key="SECRET"
aes key (str) key="password"
chacha20 key (str) key="password"
rsa key_size (int) key_size=2048

Testing

# Run all tests
python -m pytest tests/ -v

# Run specific test
python -m pytest tests/test_ciphers.py::test_caesar_cipher -v

Project Structure

cipher-toolbox/
├── cipher_tool/
│   ├── classical/
│   │   ├── substitution/
│   │   │   ├── caesar/
│   │   │   ├── atbash/
│   │   │   └── affine/
│   │   ├── polyalphabetic/
│   │   │   ├── vigenere/
│   │   │   ├── autokey/
│   │   │   └── beaufort/
│   │   └── transposition/
│   │       ├── rail_fence/
│   │       └── columnar_transposition/
│   ├── modern/
│   │   ├── symmetric/
│   │   │   ├── xor/
│   │   │   ├── aes/
│   │   │   └── chacha20/
│   │   └── asymmetric/
│   │       └── rsa/
│   └── core/
│       ├── base.py
│       └── registry.py
├── tests/
├── cli.py
└── README.md

Educational Purpose

This toolbox is designed for educational purposes to help understand:

  • Classical cryptographic techniques
  • Modern encryption algorithms
  • Cryptographic principles and concepts
  • Implementation differences between cipher types

Security Notice

⚠️ Warning: This implementation is for educational purposes only. Do not use these implementations for securing sensitive data in production environments. Use well-tested, production-ready cryptographic libraries instead.

Contributors

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

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

Author

Gabriel Dakinah Vincent

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cipher_toolbox-0.1.3.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cipher_toolbox-0.1.3-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file cipher_toolbox-0.1.3.tar.gz.

File metadata

  • Download URL: cipher_toolbox-0.1.3.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for cipher_toolbox-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e95b7b358fc1f66e46977211c0e78f4c21c847897786a00754a113c6b9a07748
MD5 cbdd1f808598c3c80cc26062621a458c
BLAKE2b-256 c0d4c265b3b7943967fb2d524ef971a0a921a155deafd8ef93280fca73effaf3

See more details on using hashes here.

File details

Details for the file cipher_toolbox-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cipher_toolbox-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for cipher_toolbox-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fac4e6cbc91beae2fc8b36bb0b029d73e400140ad3b6f408852eff60eb9ea09f
MD5 b5406ab5fb0eb3a8f7a4560970d67a34
BLAKE2b-256 f3f24cdd357dda534cea2c055cfa890e7d3b566e6f5b8141eaf411a343af8b12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page