App 3: Password Generator & Checker / Build the password tool
Lesson 5 of 10
Passphrases
Four or five random words like 'orbit-lamp-sugar-tide' are long, strong and easy to remember. Pick words securely from a word list.
Key points
- Length beats complexity
- Use secrets.choice for each word
- Join with dashes
WORDS = ["orbit", "lamp", "sugar", "tide", "falcon", "cactus", "pixel", "river", "zebra", "nova"]
def passphrase(n=5):
return "-".join(secrets.choice(WORDS) for _ in range(n))Your turn
Make your word list at least 50 words long and add passphrase() to the menu.
Quiz · +10 XP
Why can a passphrase beat a short complex password?
Log in to save progress and earn XP.