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 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.3.tar.gz
(26.2 kB
view hashes)
Built Distributions
Close
Hashes for pep272_encryption-0.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3587621c6a053af250b7d472326e00080b1a9ceb936b55252e482fdb46115aea |
|
MD5 | 1a75c3a4f4cdb80173c77b2a9549422e |
|
BLAKE2b-256 | ea0e156c7670ad236d397cff2d2ad63fcd338932160b89a9f64a4fc8e3aa02e3 |
Close
Hashes for pep272_encryption-0.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1657d2abb19c144f89d8ae58c05ec91dd1084e47489b5a95048b7c555b400244 |
|
MD5 | e3a30273fd0bc7128b6185e5eb836789 |
|
BLAKE2b-256 | 1413099ef6709f2881730054164a17d23490448f2c4edcf4110a77f05a8ea58e |
Close
Hashes for pep272_encryption-0.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fe708efc1621eab2439106b865173180eab528b0bf1a069366680013c6b74fc |
|
MD5 | 718c905dda07872311d88db50a5f992a |
|
BLAKE2b-256 | a874e7dbdfaa9b64ceede88e10b47da139aa3de95d18cc2d7dfc0892115920fc |
Close
Hashes for pep272_encryption-0.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c3889ed726cefa0f3e9764a6a88a3d850994b0e54107b9d4f1f1d47c3762a63 |
|
MD5 | a1bf71191df23fb7d029a597bdddd19d |
|
BLAKE2b-256 | 3072392b775bcfc64544cfb63aa7091846958a6b7b150f1c30b001833c16ec0f |
Close
Hashes for pep272_encryption-0.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8233389d35bea3f49a21532b539375dd162b8d047cb7fed4007c16a48c7ecb1d |
|
MD5 | 306a71306d30ec3a059e05d5b5f5107a |
|
BLAKE2b-256 | 76ce7c5db299ae5c689a55b13d1311abf537f7c430b47f2a514ade3102be7fdc |
Close
Hashes for pep272_encryption-0.3-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a7cb1e9be97eabda6656438f32b09709d07a8eb55dab5f12b6c71be51c50233 |
|
MD5 | c57991a5c4bf15471422338053f5ffd3 |
|
BLAKE2b-256 | 5d81494dd0f31148d8a26005ec0e361379eb69236d83e07cd367382af03bfd9a |
Close
Hashes for pep272_encryption-0.3-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ce515ffbd75bf7fe32cbda2147ec291166496e5f6a11e3399f42082f67eecb1 |
|
MD5 | 911c3d9d478b0efe10dbffaf6e723539 |
|
BLAKE2b-256 | 4cbf5314f4a5142693d15deb9b1ba21f106afa1d7b34f7dd1d0c144ea67bc6dc |
Close
Hashes for pep272_encryption-0.3-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5e9feda51b269143521684a09fdc05acf9757b31baa048cc066d724e977310 |
|
MD5 | 0ecc6124af86dba9a7dc726b3681a0f9 |
|
BLAKE2b-256 | 6407482c447d2c1b15fc28bcd38d64b56ea002668211f8115d3ea7ad83c4b2b7 |
Close
Hashes for pep272_encryption-0.3-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f2f27d54b3060fbef28b85dabb399da019c61e25edc32105350a4516665ddec |
|
MD5 | a0ba203f9b44b5299fe6b463282cf9d9 |
|
BLAKE2b-256 | 00851d61765a9aaca1d33e8faea775961674469efa25422f7e63fa4e210f4cf6 |
Close
Hashes for pep272_encryption-0.3-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf11f3eb199481dc04f8e3aed7bf464382a7f63759cb090e4f9d92541cdf4883 |
|
MD5 | d93d5c32ee5f3a68fe83c59885d61128 |
|
BLAKE2b-256 | 21bbe49e4b8ef3f5f9f736a41fd8ef5eb959a5317b0292a3af316815bdb1d6ce |