Include fingerprint salt in password key derivation

This commit is contained in:
thePR0M3TH3AN
2025-08-03 09:37:59 -04:00
parent 2794b67d83
commit 5423c41b06
13 changed files with 102 additions and 44 deletions

View File

@@ -4,6 +4,7 @@ from cryptography.fernet import Fernet
from helpers import TEST_PASSWORD, TEST_SEED
from utils.key_derivation import derive_key_from_password
from utils.fingerprint import generate_fingerprint
sys.path.append(str(Path(__file__).resolve().parents[1]))
@@ -11,7 +12,8 @@ from seedpass.core.encryption import EncryptionManager
def test_parent_seed_migrates_from_fernet(tmp_path: Path) -> None:
key = derive_key_from_password(TEST_PASSWORD)
fp = generate_fingerprint(TEST_SEED)
key = derive_key_from_password(TEST_PASSWORD, fp)
fernet = Fernet(key)
encrypted = fernet.encrypt(TEST_SEED.encode())
legacy_file = tmp_path / "parent_seed.enc"