added decryption version functions
This commit is contained in:
@@ -145,8 +145,16 @@ def encrypt(client, data):
|
|||||||
logger.error(e)
|
logger.error(e)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def decrypt(client, data):
|
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:
|
try:
|
||||||
array_json = base64.b64decode(data)
|
array_json = base64.b64decode(data)
|
||||||
array = json.loads(array_json)
|
array = json.loads(array_json)
|
||||||
|
|||||||
Reference in New Issue
Block a user