added decryption version functions

This commit is contained in:
crp3844
2022-09-07 10:26:56 -04:00
parent 469c838447
commit e16cd74e4d

View File

@@ -144,9 +144,17 @@ def encrypt(client, data):
except Exception as e:
logger.error(e)
def decrypt(client, data):
array_json = base64.b64decode(data)
array = json.loads(array_json)
match array['version']:
case 1:
decrypt_v1(client, data)
case _:
logger.error("Unable to detemine encryption version.")
def decrypt_v1(client, data):
try:
array_json = base64.b64decode(data)
array = json.loads(array_json)