Library for easy creation of PEP-272 cipher classes
Project description
To prevent reinventing the wheel to create a PEP-272 for a new block cipher encryption this library aims to create an extensible framework for new libraries.
Currently following modes of operation are supported:
ECB
CBC
CFB
OFB
CTR
The PGP mode of operation is not supported. It may be added in the future.
Example
In this example encrypt_aes(key, block) will encrypt one block of AES while decrypt_aes(key, block) will decrypt one.
>>> from pep272_encryption import PEP272Cipher, MODE_ECB >>> class AESCipher: ... """ ... PEP-272 cipher class for AES ... """ ... block_size = 16 ... ... def encrypt_block(self, key, block): ... return encrypt_aes(key, block) ... ... def decrypt_block(self, key, block): ... return decrypt_aes(key, block) ... >>> cipher = AESCipher(b'\00'*16, MODE_ECB) >>> cipher.encrypt(b'\00'*16) b'f\xe9K\xd4\xef\x8a,;\x88L\xfaY\xca4+.'
License
This project is licensed under CC0 (public domain).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pep272-encryption-0.1.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for pep272_encryption-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1771ae613316e1b317ae7bfda9d32a5fc3ff189acef26d7d661df3846e01a5a |
|
MD5 | 81500b083c20b7b467e654d226509f8d |
|
BLAKE2b-256 | fa1b73b07d044a4636f7a9288ccec2a8b0d005ce884f6321c531a7d998b5bc1c |