mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
Merge pull request #132 from PR0M3TH3AN/codex/add-change-encryption-mode-option
Add encryption mode settings option
This commit is contained in:
30
src/main.py
30
src/main.py
@@ -456,12 +456,13 @@ def handle_settings(password_manager: PasswordManager) -> None:
|
|||||||
print("1. Profiles")
|
print("1. Profiles")
|
||||||
print("2. Nostr")
|
print("2. Nostr")
|
||||||
print("3. Change password")
|
print("3. Change password")
|
||||||
print("4. Verify Script Checksum")
|
print("4. Change encryption mode")
|
||||||
print("5. Backup Parent Seed")
|
print("5. Verify Script Checksum")
|
||||||
print("6. Export database")
|
print("6. Backup Parent Seed")
|
||||||
print("7. Import database")
|
print("7. Export database")
|
||||||
print("8. Lock Vault")
|
print("8. Import database")
|
||||||
print("9. Back")
|
print("9. Lock Vault")
|
||||||
|
print("10. Back")
|
||||||
choice = input("Select an option: ").strip()
|
choice = input("Select an option: ").strip()
|
||||||
if choice == "1":
|
if choice == "1":
|
||||||
handle_profiles_menu(password_manager)
|
handle_profiles_menu(password_manager)
|
||||||
@@ -470,20 +471,27 @@ def handle_settings(password_manager: PasswordManager) -> None:
|
|||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
password_manager.change_password()
|
password_manager.change_password()
|
||||||
elif choice == "4":
|
elif choice == "4":
|
||||||
password_manager.handle_verify_checksum()
|
try:
|
||||||
|
mode = password_manager.prompt_encryption_mode()
|
||||||
|
password_manager.change_encryption_mode(mode)
|
||||||
|
except Exception as exc:
|
||||||
|
logging.error(f"Error changing encryption mode: {exc}", exc_info=True)
|
||||||
|
print(colored(f"Error: Failed to change encryption mode: {exc}", "red"))
|
||||||
elif choice == "5":
|
elif choice == "5":
|
||||||
password_manager.handle_backup_reveal_parent_seed()
|
password_manager.handle_verify_checksum()
|
||||||
elif choice == "6":
|
elif choice == "6":
|
||||||
password_manager.handle_export_database()
|
password_manager.handle_backup_reveal_parent_seed()
|
||||||
elif choice == "7":
|
elif choice == "7":
|
||||||
|
password_manager.handle_export_database()
|
||||||
|
elif choice == "8":
|
||||||
path = input("Enter path to backup file: ").strip()
|
path = input("Enter path to backup file: ").strip()
|
||||||
if path:
|
if path:
|
||||||
password_manager.handle_import_database(Path(path))
|
password_manager.handle_import_database(Path(path))
|
||||||
elif choice == "8":
|
elif choice == "9":
|
||||||
password_manager.lock_vault()
|
password_manager.lock_vault()
|
||||||
print(colored("Vault locked. Please re-enter your password.", "yellow"))
|
print(colored("Vault locked. Please re-enter your password.", "yellow"))
|
||||||
password_manager.unlock_vault()
|
password_manager.unlock_vault()
|
||||||
elif choice == "9":
|
elif choice == "10":
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print(colored("Invalid choice.", "red"))
|
print(colored("Invalid choice.", "red"))
|
||||||
|
Reference in New Issue
Block a user