aesio

AES encryption routines

The AES module contains classes used to implement encryption and decryption. It aims to be low overhead in terms of memory.

class aesio.AES(key: ReadableBuffer, mode: int = 0, iv: Optional[ReadableBuffer] = None, segment_size: int = 8)

Encrypt and decrypt AES streams

encrypt_into(self, src: ReadableBuffer, dest: WriteableBuffer)

Encrypt the buffer from src into dest.

For ECB mode, the buffers must be 16 bytes long. For CBC mode, the buffers must be a multiple of 16 bytes, and must be equal length. For CTX mode, there are no restrictions.

decrypt_into(self, src: ReadableBuffer, dest: WriteableBuffer)

Decrypt the buffer from src into dest. For ECB mode, the buffers must be 16 bytes long. For CBC mode, the buffers must be a multiple of 16 bytes, and must be equal length. For CTX mode, there are no restrictions.