mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-04 20:02:05 +00:00
Complete security item 3 hardening and redaction sweep
This commit is contained in:
1 parent
fcbe2b2943
commit
56b68bd0ac
11 files changed
+201
-55
No files matched your search
@@ -30,15 +30,13 @@ def generate_fingerprint(seed_phrase: str, length: int = 16) -> Optional[str]:
|
||||
try:
|
||||
# Normalize the seed phrase
|
||||
normalized_seed = seed_phrase.strip().lower()
|
||||
logger.debug(f"Normalized seed: {normalized_seed}")
|
||||
|
||||
# Compute SHA-256 hash
|
||||
sha256_hash = hashlib.sha256(normalized_seed.encode("utf-8")).hexdigest()
|
||||
logger.debug(f"SHA-256 Hash: {sha256_hash}")
|
||||
|
||||
# Truncate to desired length
|
||||
fingerprint = sha256_hash[:length].upper()
|
||||
logger.debug(f"Generated Fingerprint: {fingerprint}")
|
||||
logger.debug("Generated seed fingerprint successfully.")
|
||||
|
||||
return fingerprint
|
||||
except Exception as e:
|
||||
|
||||
Reference in new issue
Block a user