xkcdpass is a Python library that generates secure multiword passwords or passphrases inspired by the XKCD comic 'Password Strength'. It provides tools to create memorable yet strong passphrases using various wordlists and configuration options. The library is actively maintained with a consistent release cadence, with the current version being 1.30.0.
pip install xkcdpassVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to generate a strong, memorable passphrase using the bundled wordlist. It first locates the wordlist, processes it to meet specific length criteria, and then generates a 4-word passphrase using a hyphen as a separator.
If your application relies on the old default, explicitly specify `separator=' '` when calling `generate_xkcdpassword()`.
Always use a robust wordlist, ideally the bundled one via `xp.locate_wordlist()` or a carefully curated, large custom list. Ensure `numwords` is sufficiently high (e.g., 4 or more) to maintain entropy.
If you relied on set-specific operations (like fast `in` checks or automatic deduplication from a list converted to a set), be aware that this behavior changed. For unique words, the generation process already handles this, but type-specific operations might need adjustment.
Run `pip install xkcdpass` to install the library.
Change your import statement to `import xkcdpass.xkcd_password as xp` and then call functions like `xp.generate_xkcdpassword()`.
Ensure the path to your custom wordlist is correct and the file exists. If using the bundled wordlist, ensure `xp.locate_wordlist()` is called correctly and that the library was installed properly to include its data files.
No dependency data recorded yet.