Library for easy creation of PEP-272 cipher classes
Project description
To prevent reinventing the wheel while creating a PEP-272 interface 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, **kwargs): ... return encrypt_aes(key, block) ... ... def decrypt_block(self, key, block, **kwargs): ... 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 CC0 licensed (= 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.4.tar.gz
(14.4 kB
view hashes)
Built Distributions
Close
Hashes for pep272_encryption-0.4-py2.pp35.pp36.pp37.pp38.pp39-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c448584f1ba3cfb82b1e17fbf72f6f4a37b605feec14ee2ef8b9a41841084c61 |
|
MD5 | 1ba784ce7bd3c6257ee351327a626abb |
|
BLAKE2b-256 | a88220d9681012c263c5eaca4d214737a2c6a63b156677067265cf6399cd4cc3 |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b506f09cb1411989578909f87bf2c0ff08a897b6d9092c44bc2a26cc40bc9bd |
|
MD5 | fe2871d02505fd2762490121ef28b01b |
|
BLAKE2b-256 | 6c7c15329ff8d9a7c9654d064753dc896ba65e7977875e25330a12644295eb93 |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8059126cc8e635b9d3f059e66dd79230197c75badac96c43465bd6f30554e82 |
|
MD5 | 8ae3173b0421d4ff151f9139be790eb9 |
|
BLAKE2b-256 | cf90985dcdb755983200e5e274696886551a879d2820e2b576d1dd2deae14d77 |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22933a27b619c19d336ff9c1e88ec04f424d15bc31e1625f81d94fa2f53094fd |
|
MD5 | e054481ecd0f022b77b6e1372af43eda |
|
BLAKE2b-256 | eb823fb508a2154212e1c9b2d662b60070cc90961827abdc20a106a6aa6776ba |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d285fbedf6f4535b389628c9abc6a2cbf2030763b48e638c5e92bb26f7fd138 |
|
MD5 | 5ac390fac26705927132c74ef621230f |
|
BLAKE2b-256 | 0326d7784baffe4a210c09bca0ace005f46870b5d480149e9993d859b79aa95a |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42825bf72446c1db781b2d48f033603089c87c4585e219602fd25390baea2bf3 |
|
MD5 | a2300470c5f36397c78e1c388549df0b |
|
BLAKE2b-256 | 5d7967f8efa69ac867742fad643bc135310a021f9b06063c65f99e1108ceddc7 |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23f29e134c2a85d4d24b32f8b632d4f31ec191dcb9f3691f56bb1ade08cd466 |
|
MD5 | 45fcd9ef88731dfd47da593e6694866a |
|
BLAKE2b-256 | 77f304d5733c196f47b2f82877ee55b5517b98b3f58aec9d2027e83234ce679d |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cd052486ca58c266daa873b6ecf741cedf04712b1a67a231238639f035519bf |
|
MD5 | 18cd392e3b2db719f428cbe3bb5f7eb2 |
|
BLAKE2b-256 | 79a27c2a99998c2bbaf98bb1463a21be35577abaaf16eee514fb4d2ebaf431b1 |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13077d4d34bcd492ae6b8ee9da40cc1c7fdd6dc3e0a9ad4b220bafcdce9c81ee |
|
MD5 | 3acd4bc7676bb58baf8174e4a91fcb01 |
|
BLAKE2b-256 | 0f187ab2f74dc36c43da926cf4d3036be1b64ccd6931351fcc5511e645c7cbfc |
Close
Hashes for pep272_encryption-0.4-cp35-abi3-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb82c71de1b6a4345b6eca242dcccf8b7528f8b62e19d0e23934056ac6b14fd2 |
|
MD5 | 2d77cbf23b536ec38025118268111054 |
|
BLAKE2b-256 | b6225c04f8531b4daefb07e7adbd9f266cf261df764264fc646404e7c2dd5378 |