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
Built Distributions
File details
Details for the file pep272-encryption-0.4.tar.gz
.
File metadata
- Download URL: pep272-encryption-0.4.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8635cf74ca9488808d367b3c4d355fb1a1c5ec3ffd02a685ec3f7b19a12bc550 |
|
MD5 | 76ac86a4d6883842202d72de065e8c7e |
|
BLAKE2b-256 | 0ab80bc2f973306e09316fa6a00bf0c4740ae35b52e78c5e34cdd656a4abc0b4 |
File details
Details for the file pep272_encryption-0.4-py2.pp35.pp36.pp37.pp38.pp39-none-any.whl
.
File metadata
- Download URL: pep272_encryption-0.4-py2.pp35.pp36.pp37.pp38.pp39-none-any.whl
- Upload date:
- Size: 36.9 kB
- Tags: PyPy, Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c448584f1ba3cfb82b1e17fbf72f6f4a37b605feec14ee2ef8b9a41841084c61 |
|
MD5 | 1ba784ce7bd3c6257ee351327a626abb |
|
BLAKE2b-256 | a88220d9681012c263c5eaca4d214737a2c6a63b156677067265cf6399cd4cc3 |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-win_amd64.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-win_amd64.whl
- Upload date:
- Size: 18.2 kB
- Tags: CPython 3.5+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b506f09cb1411989578909f87bf2c0ff08a897b6d9092c44bc2a26cc40bc9bd |
|
MD5 | fe2871d02505fd2762490121ef28b01b |
|
BLAKE2b-256 | 6c7c15329ff8d9a7c9654d064753dc896ba65e7977875e25330a12644295eb93 |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-win32.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-win32.whl
- Upload date:
- Size: 17.8 kB
- Tags: CPython 3.5+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8059126cc8e635b9d3f059e66dd79230197c75badac96c43465bd6f30554e82 |
|
MD5 | 8ae3173b0421d4ff151f9139be790eb9 |
|
BLAKE2b-256 | cf90985dcdb755983200e5e274696886551a879d2820e2b576d1dd2deae14d77 |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-manylinux2014_s390x.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-manylinux2014_s390x.whl
- Upload date:
- Size: 26.1 kB
- Tags: CPython 3.5+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22933a27b619c19d336ff9c1e88ec04f424d15bc31e1625f81d94fa2f53094fd |
|
MD5 | e054481ecd0f022b77b6e1372af43eda |
|
BLAKE2b-256 | eb823fb508a2154212e1c9b2d662b60070cc90961827abdc20a106a6aa6776ba |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-manylinux2014_ppc64le.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-manylinux2014_ppc64le.whl
- Upload date:
- Size: 27.1 kB
- Tags: CPython 3.5+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d285fbedf6f4535b389628c9abc6a2cbf2030763b48e638c5e92bb26f7fd138 |
|
MD5 | 5ac390fac26705927132c74ef621230f |
|
BLAKE2b-256 | 0326d7784baffe4a210c09bca0ace005f46870b5d480149e9993d859b79aa95a |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-manylinux2014_aarch64.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-manylinux2014_aarch64.whl
- Upload date:
- Size: 27.0 kB
- Tags: CPython 3.5+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42825bf72446c1db781b2d48f033603089c87c4585e219602fd25390baea2bf3 |
|
MD5 | a2300470c5f36397c78e1c388549df0b |
|
BLAKE2b-256 | 5d7967f8efa69ac867742fad643bc135310a021f9b06063c65f99e1108ceddc7 |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-manylinux1_x86_64.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-manylinux1_x86_64.whl
- Upload date:
- Size: 21.5 kB
- Tags: CPython 3.5+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23f29e134c2a85d4d24b32f8b632d4f31ec191dcb9f3691f56bb1ade08cd466 |
|
MD5 | 45fcd9ef88731dfd47da593e6694866a |
|
BLAKE2b-256 | 77f304d5733c196f47b2f82877ee55b5517b98b3f58aec9d2027e83234ce679d |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-manylinux1_i686.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-manylinux1_i686.whl
- Upload date:
- Size: 21.1 kB
- Tags: CPython 3.5+
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cd052486ca58c266daa873b6ecf741cedf04712b1a67a231238639f035519bf |
|
MD5 | 18cd392e3b2db719f428cbe3bb5f7eb2 |
|
BLAKE2b-256 | 79a27c2a99998c2bbaf98bb1463a21be35577abaaf16eee514fb4d2ebaf431b1 |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-macosx_10_9_universal2.whl
- Upload date:
- Size: 16.8 kB
- Tags: CPython 3.5+, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13077d4d34bcd492ae6b8ee9da40cc1c7fdd6dc3e0a9ad4b220bafcdce9c81ee |
|
MD5 | 3acd4bc7676bb58baf8174e4a91fcb01 |
|
BLAKE2b-256 | 0f187ab2f74dc36c43da926cf4d3036be1b64ccd6931351fcc5511e645c7cbfc |
File details
Details for the file pep272_encryption-0.4-cp35-abi3-macosx_10_6_intel.whl
.
File metadata
- Download URL: pep272_encryption-0.4-cp35-abi3-macosx_10_6_intel.whl
- Upload date:
- Size: 16.6 kB
- Tags: CPython 3.5+, macOS 10.6+ intel
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb82c71de1b6a4345b6eca242dcccf8b7528f8b62e19d0e23934056ac6b14fd2 |
|
MD5 | 2d77cbf23b536ec38025118268111054 |
|
BLAKE2b-256 | b6225c04f8531b4daefb07e7adbd9f266cf261df764264fc646404e7c2dd5378 |