Interfacing AES library on ESP8266 with PyCryptodome on Rpi

Hi,

I am attempting to send some information between an ESP8266 and a Raspberry Pi running a Python Flask proxy server. I wish to encrypt the contents of this communication using this AES library. So far I have succeeded in encrypting and decrypting a simple string using it. I then moved to encoding the byte array containing the cipher to base64 so that it could be sent to the raspberry pi for decryption, using this library. So far so good.

The Arduino code:

#include <Base64.h>
#include <AES.h>
AES aes; 
byte* plain = (unsigned char*)"sixteen byte key";
byte key[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

byte cipher[4*N_BLOCK];
byte check[4*N_BLOCK];
char cipherChars[4*N_BLOCK];

void setup() {
  Serial.begin(57600);
  byte succ = aes.set_key(key, sizeof(key));
  succ = aes.encrypt(plain, cipher);
  Serial.println();
  succ = aes.decrypt(cipher, check);
  aes.clean();
  
  for(int i = 0; i < sizeof(cipher); i++) {
    cipherChars[i] = (char)(cipher[i]);
  }
  int cipherCharSize = sizeof(cipherChars);
  int encodedLength = Base64.encodedLength(cipherCharSize);
  char encodedString[encodedLength];
  Base64.encode(encodedString, cipherChars, cipherCharSize);
  Serial.println("---------");
  Serial.println(encodedString);
  
 
  yield();
  
}

void loop() {}

I then went and looked at the example code for PyCryptodome and wrote this simple decryption program in Python:

from Crypto.Cipher import AES
from base64 import b64encode, b64decode
from Crypto.Util.Padding import pad, unpad

def decrypt(cipher, passkey):
    ct = b64decode(cipher)
    cipher = AES.new(passkey, AES.MODE_ECB)
    return(unpad(cipher.decrypt(ct), 16))

message = decrypt("nVsHWYGBetev9uC4U0LGwgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA====", b'0000000000000000').decode('utf-8')
print("and the decrypted message is..." + message)

However, the problem is that I am presented with:

ValueError: Padding is incorrect.

As I understand it the block size for the library I am using is 16 and so I am rather confused as to why the padding is incorrect. Though this question may seem like a Python question I feel that it is more of an Arduino question as I am sure that the error originates from my understanding of how large the padding applied by the Arduino library is.

Did you every have any luck with this?