Skip to content

Instantly share code, notes, and snippets.

@ObjectBoxPC
Created July 29, 2025 05:28
Show Gist options
  • Save ObjectBoxPC/f974d9bc894c8af28959dc0bf733d8dc to your computer and use it in GitHub Desktop.
Save ObjectBoxPC/f974d9bc894c8af28959dc0bf733d8dc to your computer and use it in GitHub Desktop.
Create "hybrid" passwords with a combination of Diceware words and random symbols
#!/usr/bin/env python3
import secrets
import string
WORD_LIST = "/usr/share/keepassxc/wordlists/eff_large.wordlist"
words = [w.strip() for w in open(WORD_LIST)]
symbols = string.ascii_letters + string.digits + string.punctuation
word_part = " ".join(secrets.choice(words) for _ in range(4))
symbol_part = "".join(secrets.choice(symbols) for _ in range(4))
print("{} {}".format(word_part, symbol_part))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment