AES encryption library written entirely in pure python. No other system dependencies required.
Project description
What?
The original zero dependency python only AES implemntation. See
tips ethercrypt.eth
Installation
pip3 install purePyAES
Example Usage
from purePyAES.py_aes import AesWrapper
def gen_random_key():
with open("/dev/urandom", 'rb') as fb:
fb = fb.read(32)
return fb.hex().__str__()
if __name__ == "__main__":
"""
Example usage. Super straightforward.
First written for BlitzKloud. There was no pure python AES
at that time.
"""
# Generate a key. Must be either 8,16, or 32 characters
print('[+] Generating a random AES key ...')
key = gen_random_key()[:32]
print('[+] AES key generated: {}'.format(key))
aes = AesWrapper(key.encode()) # also should be bytes
enc_input = input('type something >> ') # input some data to encrypt
if not enc_input or enc_input.strip('\r\n') == '':
print("[+] Or don't")
enc_input = 'test this data'
print('[+] We will use `test this data` then ...')
print('[encrypted] (b64 wrapped) aes encrypted data `aes.encrypt`: ')
enc_data = aes.encrypt(enc_input)
print(enc_data)
denc_data = aes.decrypt(enc_data)
print('aes.decrypt: ')
print('[decrypted] %s data aes.decrypt`')
print(denc_data)
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
purepyaes-0.0.6.tar.gz
(21.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
purepyaes-0.0.6-py3-none-any.whl
(23.1 kB
view details)
File details
Details for the file purepyaes-0.0.6.tar.gz.
File metadata
- Download URL: purepyaes-0.0.6.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef37e0574772155461100727c1a6278d2a660b01c03a1c860d98c82cd98d64fc
|
|
| MD5 |
866420af075700d904f3c1aec4791655
|
|
| BLAKE2b-256 |
76b67921a9bc108b46efd2e993af4f192c63de3faaf2d28b1bcb12198a4b927b
|
File details
Details for the file purepyaes-0.0.6-py3-none-any.whl.
File metadata
- Download URL: purepyaes-0.0.6-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd64b90580057cd09c0741277a518e8819b11886ec2e96542775860966f1fdde
|
|
| MD5 |
bc346b1e0375e353eefb1fa2f92f67f3
|
|
| BLAKE2b-256 |
9a0218a9da2a5c4d5471c118a8da9fd863af4a37df78d4e13863e1d7b22ff412
|