mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-05 20:32:05 +00:00
tests: use AES-GCM key generation
This commit is contained in:
1 parent
f4a169ca80
commit
f7c2017f1c
9 files changed
+31
-20
No files matched your search
@@ -3,7 +3,8 @@ import sys
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
|
||||
from cryptography.fernet import Fernet
|
||||
import os
|
||||
import base64
|
||||
|
||||
sys.path.append(str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
@@ -24,7 +25,7 @@ def test_generate_fingerprint_deterministic():
|
||||
|
||||
def test_encryption_round_trip():
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
key = Fernet.generate_key()
|
||||
key = base64.urlsafe_b64encode(os.urandom(32))
|
||||
manager = EncryptionManager(key, Path(tmpdir))
|
||||
data = b"secret data"
|
||||
rel_path = Path("testfile.enc")
|
||||
|
||||
Reference in new issue
Block a user