Skip to main content

Vigenere cipher encryption for Python

Project description

vigenere-py

PyPI Changelog Tests License

Installation

Install this package with pipx for use as a standalone CLI:

pipx install vigenere-py

vigenere --help

Alternatively, you can install this package for use as a library via pip (ideally run this inside a virtualenv):

pip install vigenere-py

Usage

For help, run:

vigenere --help

You can also use:

python -m vigenere --help

Examples

Generating a key and encrypting:

$ vigenere genkey -a letters 20 > key.txt

$ cat key.txt
RVRTCLIWHNPZAOJLXEWY

$ cat plain.txt
ATTACK AT DAWN

$ vigenere enc -a letters -k key.txt plain.txt
ROKTEV IP KNLM

Decrypting:

$ cat key.txt
RVRTCLIWHNPZAOJLXEWY

$ cat cipher.txt
ROKTEV IP KNLM

$ vigenere dec -a letters -k key.txt cipher.txt
ATTACK AT DAWN

Interactive mode, end the message with ctrl+d:

$ vigenere enc -a letters
Key: •••••••••••••••••
Text to encrypt:
SECRET MESSAGE
Ciphertext:
QSWIIT PXZWDUG

Bash shell completions

_VIGENERE_COMPLETE=bash_source vigenere > ~/.local/share/bash-completion/completions/vigenere

Development

To contribute to this tool, first checkout the code.

Poetry

Poetry is used to manage dependencies and virtualenvs. So install poetry before proceeding.

I recommend installing poetry with pipx.

pipx install poetry

But if you don't want to use pipx, there are other installation instructions here: https://python-poetry.org/docs/#installation

Installing dependencies

cd vigenere-py
poetry install

Running the app

poetry run vigenere --help

Running tests

poetry run mypy .
poetry run pytest -v

Or, you can run these as a poe task:

Install poe:

pipx install poethepoet

Run tests:

poe test

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

vigenere_py-0.1.4.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

vigenere_py-0.1.4-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

Supported by

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