add converter v1
This commit is contained in:
1 parent
080f000fd2
commit
5c8d9aa864
9 files changed
+259
-14
No files matched your search
@@ -11,6 +11,7 @@ from app.core._crypto.cipher import AESCipher
|
||||
from app.core.models.keys import KnownKey
|
||||
from app.core.models.node_storage import StoredContent
|
||||
from app.core.logger import make_log
|
||||
from base58 import b58decode
|
||||
|
||||
|
||||
async def create_new_encryption_key(db_session, user_id: int = None) -> KnownKey:
|
||||
@@ -63,8 +64,7 @@ async def create_encrypted_content(
|
||||
assert decrypted_content.key_id, "Key not assigned"
|
||||
|
||||
decrypted_path = os.path.join(UPLOADS_DIR, decrypted_content.hash)
|
||||
async with aiofiles.open(decrypted_path, mode='rb') as file:
|
||||
decrypted_bin = await file.read()
|
||||
decrypted_bin = b58decode(decrypted_content.hash)
|
||||
|
||||
key = decrypted_content.key
|
||||
cipher = AESCipher(key.seed_bin)
|
||||
|
||||
Reference in new issue
Block a user