Android App encrypt requires bytes

This commit is contained in:
JonnyWong16
2020-03-21 20:05:59 -07:00
parent 510dddf724
commit 42262b0bb6

View File

@@ -897,7 +897,7 @@ class ANDROIDAPP(Notifier):
# Encrypt using AES GCM
nonce = get_random_bytes(16)
cipher = AES.new(key, AES.MODE_GCM, nonce)
encrypted_data, gcm_tag = cipher.encrypt_and_digest(json.dumps(plaintext_data))
encrypted_data, gcm_tag = cipher.encrypt_and_digest(json.dumps(plaintext_data).encode('utf-8'))
encrypted_data += gcm_tag
#logger.debug("Encrypted data (base64): {}".format(base64.b64encode(encrypted_data)))