Skip to main content

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.

Metadata

Release files for ciphers-vbcd 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ciphers-vbcd 0.2.0
File Size Uploaded
ciphers_vbcd-0.2.0.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ciphers-vbcd 0.2.0
File Interpreter ABI Platform
ciphers_vbcd-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / ciphers_vbcd-0.2.0.tar.gz

Download URL ciphers_vbcd-0.2.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dd26884d333eba15193d2df483a2d90caa3ca89aa7392a5977b1b9741a1b265c
BLAKE2b-256 checksum
How to use checksums
16c1a6b87e3d29ea5a7df5735d452ea3ff7b3cde0318c5d3051ccae5a20f2d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / ciphers_vbcd-0.2.0-py3-none-any.whl

Download URL ciphers_vbcd-0.2.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59cd1e98ed94d4d5b626fd6de4210c727b8466057960c001003abe0c29eb5f4f
BLAKE2b-256 checksum
How to use checksums
c99c750a17f1d9e591341ef4e5b4fc4bea22dc47051f44dccc0f456dbd9b5da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page