mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:26:30 +00:00
use cbc encryption decryption - works nice with c#
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user