aes_ecb

Module for AES-ECB encryption/decryption.

class AesEcbEncrypter(key: Union[str, bytes])

Bases: object

AES-ECB encrypter class. It encrypts data using AES-ECB algorithm.

aes: Any
auto_pad: bool
AutoPad(value: bool) None

Set the auto-pad flag.

Parameters:

value (bool) – Flag value

Encrypt(data: Union[str, bytes]) bytes

Encrypt data using AES-ECB algorithm.

Parameters:

data (str or bytes) – Data to be encrypted

Returns:

Encrypted data

Return type:

bytes

static Pad(data: Union[str, bytes]) bytes

Pad data using PKCS7 algorithm.

Parameters:

data (str or bytes) – Data to be padded

Returns:

Padded data

Return type:

bytes

class AesEcbDecrypter(key: Union[str, bytes])

Bases: object

AES-ECB decrypter class. It decrypts data using AES-ECB algorithm.

aes: Any
AutoUnPad(value: bool) None

Set the auto-unpad flag.

Parameters:

value (bool) – Flag value

Decrypt(data: bytes) bytes

Decrypt data using AES-ECB algorithm.

Parameters:

data (bytes) – Data to be decrypted

Returns:

Decrypted data

Return type:

bytes

static UnPad(data: bytes) bytes

Unpad data using PKCS7 algorithm.

Parameters:

data (bytes) – Data to be unpadded

Returns:

Unpadded data

Return type:

bytes