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'
It is noteworthy that the output of the encrypt function is encoded to base64. This can be changed by setting the default argument base64
to False.
encrypt(..agrs, base64=True) # returns base64 string
encrypt(..args, base64=False) # returns string of unicode chrs
Read the documention of the library
$ python
Python 3.9.0
Type "help", "copyright", "credits" or "license" for more information.
>>> import vigenere
>>> help(vigenere)
Security
The Vigenere Cipher is not a safe encryption algorithm and has multiple vulnerabilities.
One should not use this library for any official purpose, for its implementation is educational only. If you are downloading this package, it is expected that you have read the documentation and you truly understand the consequences.
I shall not be held responsible if you use this for encrypting confidential documents or messages.
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
Built Distribution
File details
Details for the file vigenere-1.1.0.tar.gz
.
File metadata
- Download URL: vigenere-1.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e999822d4836e2b0e33fa24341b4ad4d92d71c84e9e248327b1b9f9ee6043e54 |
|
MD5 | 58eccba485e5442f4e0ea0cf7b7e0026 |
|
BLAKE2b-256 | 9cdf100f94173f1ce290de90e50948c5408aa0709a9a782fbe2de4bf412595a5 |
File details
Details for the file vigenere-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: vigenere-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54d8d2f5b56ae2906060dd10765cd5752339e5d649d6d3ff0d096c2061b992d3 |
|
MD5 | a8bad2c017be7f9d6e710cedcfad80b4 |
|
BLAKE2b-256 | 2ca2f7924ac68788a3de8218c80f89062385c4d48a72287e836a3b7bd2581393 |