Skip to main content

Encrypt strings using Vigenere Cipher

Project description

Vigenere Cipher

The Vigenere cipher is a method of encrypting alphabetic text by using a series of interwoven Caesar ciphers, based on the letters of a keyword. It employs a form of polyalphabetic substitution.

Installation

This library uses python3 which can be download from here. After installing python, use pip to install the package.

$ pip install vigenere

No external dependencies required in this version.

Quick Start

Open the python shell and begin encrypting and decrypting texts with only 4 lines of commands.

>>> from vigenere import encrypt, decrypt, random_key
>>> cipher_key:str = random_key() # one can even use user-defined key such as `qwerty`
>>> cipher = encrypt('hello world', cipher_key) # with random_key function, cipher may vary everytime you run a program.
>>> decrypt(cipher, cipher_key)
'hello world'

Read the documention of the library

$ python
Python 3.9.0
Type "help", "copyright", "credits" or "license" for more information.
>>> import vigenere
>>> help(vigenere)
Help on package vigenere:

NAME
    vigenere

DESCRIPTION
    The Vigenere cipher is a method of encrypting alphabetic text by using a series of interwoven Caesar ciphers,

        ...

    In the 19th century the scheme was misattributed to Blaise de Vigenere (1523-1596), and so acquired its present name.

PACKAGE CONTENTS
    __main__
    random
    vigenere

FUNCTIONS
    decrypt(cipher: str, key: str) -> str
        Decrypt strings using Vigenere Cipher

        Args:
            cipher (str): Encrypted plain text that needs to be decrypted
            key (str): Key for vigenere cipher

        Returns:
            str: Decipher Text

    encrypt(plain_text: str, key: str) -> str
        Encrypt strings using Vigenere Cipher

        Args:
            plain_text (str): Plain text that needs to be encrypted
            key (str): Key for vigenere cipher

            Use `random_key()` to generate a key

-- More  --

WARNING: DO NOT USE THIS LIBRARY FOR ANY OFFICIAL PURPOSES, BECAUSE THIS IS FOR EDUCATIONAL USE ONLY. I WILL NOT BE RESPONSIBLE IF YOU USE THIS FOR ENCRYPTING CONFIDENTIAL DOCUMENTS OR MESSAGES.

License

MIT License

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-1.0.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

vigenere-1.0.0-py3-none-any.whl (5.2 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