Skip to main content

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

blitzkloud

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

purepyaes-0.0.6-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

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

Hashes for purepyaes-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ef37e0574772155461100727c1a6278d2a660b01c03a1c860d98c82cd98d64fc
MD5 866420af075700d904f3c1aec4791655
BLAKE2b-256 76b67921a9bc108b46efd2e993af4f192c63de3faaf2d28b1bcb12198a4b927b

See more details on using hashes here.

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

Hashes for purepyaes-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fd64b90580057cd09c0741277a518e8819b11886ec2e96542775860966f1fdde
MD5 bc346b1e0375e353eefb1fa2f92f67f3
BLAKE2b-256 9a0218a9da2a5c4d5471c118a8da9fd863af4a37df78d4e13863e1d7b22ff412

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page