Skip to main content

A tool for ciphering messages using various algorithms

Project description

Ciphers

A Python tool for ciphering messages using various algorithms.

Installation

Basic Installation

pip install ciphers-vbc

With RSA Support

pip install ciphers-vbc[rsa]

Using uv (recommended)

# Install uv if you don't have it
pip install uv

# Create and activate a virtual environment with uv
uv venv
source .venv/bin/activate  # On Linux/macOS
# or
# .venv\Scripts\activate  # On Windows

# Install the package in development mode
uv pip install -e .

# With RSA support
uv pip install -e ".[rsa]"

Using pip

pip install -e .

# With RSA support
pip install -e ".[rsa]"

Usage

Caesar Cipher

# Encrypt a message using Caesar cipher with a shift of 3
cipher encrypt --algorithm caesar --key 3 "Hello, World!"

# Decrypt a message using Caesar cipher with a shift of 3
cipher decrypt --algorithm caesar --key 3 "Khoor, Zruog!"

RSA Cipher

First, generate an RSA key pair:

# Using OpenSSL
openssl genrsa -out private_key.pem 2048
openssl rsa -in private_key.pem -pubout -out public_key.pem

Then encrypt and decrypt messages:

# Encrypt a message using RSA with a public key
cipher encrypt --algorithm rsa --key public_key.pem "Secret message"

# Decrypt a message using RSA with a private key
cipher decrypt --algorithm rsa --key private_key.pem "encrypted_message_here"

Development

Installing Development Dependencies

With uv:

# Install development dependencies
uv pip install -e ".[dev]"

With pip:

# Install development dependencies
pip install -e ".[dev]"

Running Tests

# Run tests with pytest
pytest

# Run tests with coverage
pytest --cov=ciphers

Code Formatting and Linting

# Format code with black
black .

# Sort imports with isort
isort .

# Lint with ruff
ruff check .

# Format with ruff
ruff format .

# Type checking with mypy
mypy ciphers tests

Building and Publishing

Building the package with uv:

# Build both wheel and sdist
uv build .

# Or build specific formats
uv build --wheel .  # Only wheel
uv build --sdist .  # Only source distribution

Publishing to PyPI with uv:

# Upload to TestPyPI first to verify everything works
uv publish --index testpypi dist/*

# Upload to PyPI
uv publish dist/*

You can also use twine if you prefer:

# Install twine
uv pip install twine

# Upload to TestPyPI
python -m twine upload --repository testpypi dist/*

# Upload to PyPI
python -m twine upload dist/*

Supported Algorithms

  • Caesar Cipher: A simple substitution cipher where each letter is shifted by a fixed number of positions.
  • RSA Cipher: A public-key cryptosystem that uses asymmetric encryption for secure data transmission.

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

ciphers_vbcd-0.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

ciphers_vbcd-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file ciphers_vbcd-0.2.0.tar.gz.

File metadata

  • Download URL: ciphers_vbcd-0.2.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for ciphers_vbcd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dd26884d333eba15193d2df483a2d90caa3ca89aa7392a5977b1b9741a1b265c
MD5 5d5e395750bed13b6a337e0a6dcc1987
BLAKE2b-256 16c1a6b87e3d29ea5a7df5735d452ea3ff7b3cde0318c5d3051ccae5a20f2d48

See more details on using hashes here.

File details

Details for the file ciphers_vbcd-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ciphers_vbcd-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59cd1e98ed94d4d5b626fd6de4210c727b8466057960c001003abe0c29eb5f4f
MD5 ac5b7563b9a12de6fa429b8b033cbc69
BLAKE2b-256 c99c750a17f1d9e591341ef4e5b4fc4bea22dc47051f44dccc0f456dbd9b5da5

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