""" Helper script to generate SHA-256 password hashes for use in .env. Usage: python scripts/hash_generator.py Copy the output hash into OWNER_PASSWORD_HASH or GUEST_PASSWORD_HASH in your .env file. """ import hashlib import getpass def main(): print("--- PortIQ Password Hash Generator ---") password = getpass.getpass("Enter your desired password: ") confirm = getpass.getpass("Confirm password: ") if password != confirm: print("Error: Passwords do not match!") return hashed = hashlib.sha256(password.encode('utf-8')).hexdigest() print("\nSuccess! Add the following line to your .env file:") print(f"APP_PASSWORD_HASH={hashed}") if __name__ == "__main__": main()