Bindings for the Twofish implementation by Niels Ferguson libtwofish-dev.
Compatible with Python 2.6, 2.7 and 3.3.
The library performs a self-test at each import.
Installation
pip install twofish
Usage
Create a twofish.Twofish instance with a key of length ]0, 32] and then use the encrypt and decrypt methods on 16 bytes blocks.
All values must be binary strings (str on Python 2, bytes on Python 3)
[WARNING] this should be used in a senseful cipher mode, like CTR or CBC. If you don’t know what this mean, you should probably usa a higher level library.
Example
>>> from twofish import Twofish >>> T = Twofish(b'*secret*') >>> x = T.encrypt(b'YELLOWSUBMARINES') >>> print(T.decrypt(x).decode()) YELLOWSUBMARINES
Release files for twofish 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| twofish-0.3.0.tar.gz | 26.0 kB | Details |
Release files / twofish-0.3.0.tar.gz
| Download URL | twofish-0.3.0.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b09d8bb50d33b23ff34cafb1f9209f858f752935c6a5c901efb92a41acb830fa
|
|
BLAKE2b-256 checksum How to use checksums |
82b49eb026a8e62a04512435d3de25c93f7bda51c8b8c7991c1c0be70b5115a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |