def ecb_encrypt(message, key):
    """ Encrypts a message in AES ECB mode with a given key
    ACCEPTS: Two strings, the plaintext message and the key
    RETURNS: A bytes string of base64 encoded ciphertext
    """
aes = AES.new(key, AES.MODE_ECB)
return base64.b64encode(aes.encrypt(message)).decode()

def ecb_decrypt(encrypted, key):
    """ Decrypts a ciphertext in AES ECB mode with a given key
    ACCEPTS: Two strings, the base64 encoded ciphertext and the key
    RETURNS: A bytes string of the plaintext message
    """
зашифровать двоичные данные в двоичные, а также расшифровать