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.4.tar.gz (21.6 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.4-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file purepyaes-0.0.4.tar.gz.

File metadata

  • Download URL: purepyaes-0.0.4.tar.gz
  • Upload date:
  • Size: 21.6 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.4.tar.gz
Algorithm Hash digest
SHA256 954ef6d0d3d92a029a936479fe5cd19ff65240ae7f1f8be10d4c678b4792c81a
MD5 84f833fa4cac0a3e68169b8352b700fa
BLAKE2b-256 d7f27a5f9249ab17a0fb69bad62f23cd27b55aa73b04742595106768821bc3ba

See more details on using hashes here.

File details

Details for the file purepyaes-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: purepyaes-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 22.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 657a377a62a3e63edc396b09f74a20cdcca89892a27be0519f3e8cecdcd46253
MD5 677605951c1e6532eb17f087bd3145a6
BLAKE2b-256 f1e645caedc438451c81cc9dbfcac52056ea29cab8e40cb1f375d93c22ddb164

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