from pyDes import des, CBC, PAD_PKCS5
import binascii
from Crypto.Cipher import DES3,AES
import pyDes

def AES_Encrypt(key, data):
cipher = AES.new(key, AES.MODE_ECB)
encryptedbytes = cipher.encrypt(data)
return binascii.b2a_hex(encryptedbytes)

def AES_Decrypt(key, data):
cipher = AES.new(key, AES.MODE_ECB)
decryptedbytes = cipher.decrypt(data)
return binascii.b2a_hex(decryptedbytes)


if __name__ == '__main__':
print(AES_Encrypt(bytes.fromhex('11111111111111111111111111111111'),bytes.fromhex('2222222222222222222222222222222233333333333333333333333333333333')))
print(AES_Decrypt(bytes.fromhex('11111111111111111111111111111111'),
bytes.fromhex('2222222222222222222222222222222233333333333333333333333333333333')))