use cbc encryption decryption - works nice with c#

This commit is contained in:
Alex Bezdieniezhnykh
2025-02-28 00:49:40 +02:00
parent 58839933fc
commit 227d01ba5e
4 changed files with 27 additions and 31 deletions
+3 -8
View File
@@ -105,8 +105,8 @@ cdef class ApiClient:
hw_hash = Security.get_hw_hash(hardware)
key = Security.get_api_encryption_key(self.credentials, hw_hash)
stream = BytesIO(response.raw.read())
data = Security.decrypt_to(stream, key)
resp_bytes = response.raw.read()
data = Security.decrypt_to(resp_bytes, key)
constants.log(<str>f'Downloaded file: {filename}, {len(data)} bytes')
return data
@@ -118,9 +118,4 @@ cdef class ApiClient:
encrypted_model_bytes = encrypted_bytes_small + encrypted_bytes_big
key = Security.get_model_encryption_key()
model_bytes = Security.decrypt_to(BytesIO(encrypted_model_bytes), key)
cdef load_queue_config(self):
return self.load_bytes(constants.QUEUE_CONFIG_FILENAME).decode(encoding='utf-8')
model_bytes = Security.decrypt_to(encrypted_model_bytes, key)