{"id":13658505,"url":"https://github.com/redacted/XKCD-password-generator","last_synced_at":"2025-04-24T11:31:55.184Z","repository":{"id":1694536,"uuid":"2422928","full_name":"redacted/XKCD-password-generator","owner":"redacted","description":"Generate secure multiword passwords/passphrases, inspired by XKCD","archived":false,"fork":false,"pushed_at":"2024-06-14T13:39:16.000Z","size":9674,"stargazers_count":1324,"open_issues_count":7,"forks_count":186,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-10-29T15:04:42.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redacted.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-umich-spanishwords-00readme.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-20T14:39:06.000Z","updated_at":"2024-10-28T07:36:49.000Z","dependencies_parsed_at":"2023-07-05T15:46:39.417Z","dependency_job_id":"fc949868-0da8-4be1-a40f-62b0bc71def9","html_url":"https://github.com/redacted/XKCD-password-generator","commit_stats":{"total_commits":291,"total_committers":49,"mean_commits":5.938775510204081,"dds":0.6185567010309279,"last_synced_commit":"7f64870acaa12e6e271a5ec8d900b31e3884d9e2"},"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redacted%2FXKCD-password-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redacted%2FXKCD-password-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redacted%2FXKCD-password-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redacted%2FXKCD-password-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redacted","download_url":"https://codeload.github.com/redacted/XKCD-password-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223952514,"owners_count":17230901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:01:00.139Z","updated_at":"2025-04-24T11:31:55.150Z","avatar_url":"https://github.com/redacted.png","language":"Python","readme":"xkcdpass\n========\n\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n   :alt: Join the chat at https://gitter.im/redacted/XKCD-password-generator\n   :target: https://gitter.im/redacted/XKCD-password-generator?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n\nA flexible and scriptable password generator which generates strong passphrases, inspired by `XKCD 936 \u003chttp://xkcd.com/936/\u003e`_::\n\n    $ xkcdpass\n    \u003e correct horse battery staple\n\n.. image:: http://imgs.xkcd.com/comics/password_strength.png\n\n\n\nInstall\n=======\n\n``xkcdpass`` can be easily installed using pip::\n\n    pip install xkcdpass\n\nor manually::\n\n    python setup.py install\n\n\n\nSource\n~~~~~~\nThe latest development version can be found on github: https://github.com/redacted/XKCD-password-generator\n\nContributions welcome and gratefully appreciated!\n\n\n\nRequirements\n============\n\nPython 2 (version 2.7 or later), or Python 3 (version 3.4 or later). Running module unit tests on Python 2 requires ``mock`` to be installed.\n\n\n\nRunning ``xkcdpass``\n====================\n\n``xkcdpass`` can be called with no arguments::\n\n    $ xkcdpass\n    \u003e pinball previous deprive militancy bereaved numeric\n\nwhich returns a single password, using the default dictionary and default settings. Or you can mix whatever arguments you want::\n\n    $ xkcdpass --count=5 --acrostic='chaos' --delimiter='|' --min=5 --max=6 --valid-chars='[a-z]'\n    \u003e collar|highly|asset|ovoid|sultan\n    \u003e caper|hangup|addle|oboist|scroll\n    \u003e couple|honcho|abbot|obtain|simple\n    \u003e cutler|hotly|aortae|outset|stool\n    \u003e cradle|helot|axial|ordure|shale\n\nwhich returns\n\n* ``--count=5``   5 passwords to choose from\n* ``--acrostic='chaos'``   the first letters of which spell 'chaos'\n* ``--delimiter='|'``   joined using '|'\n* ``--min=5 --max=6``  with words between 5 and 6 characters long\n* ``--valid-chars='[a-z]'``   using only lower-case letters (via regex).\n\n\nA concise overview of the available ``xkcdpass`` options can be accessed via::\n\n    xkcdpass --help\n\n    Usage: xkcdpass [options]\n\n    Options:\n        -h, --help\n                                    show this help message and exit\n        -w WORDFILE, --wordfile=WORDFILE\n                                    Specify that the file WORDFILE contains the list of\n                                    valid words from which to generate passphrases. Multiple \n                                    wordfiles can be provided, separated by commas.\n                                    Provided wordfiles: eff-long (default), eff-short,\n                                    eff-special, legacy, spa-mich (Spanish), fin-kotus (Finnish)\n                                    ita-wiki (Italian), ger-anlx, ger-long, ger-short (German), nor-nb (Norwegian),\n                                    fr-freelang (French), pt-ipublicis / pt-l33t-ipublicis (Portuguese)\n                                    swe-short (Swedish)\n        --min=MIN_LENGTH\n                                    Minimum length of words to make password\n        --max=MAX_LENGTH\n                                    Maximum length of words to make password\n        -n NUMWORDS, --numwords=NUMWORDS\n                                    Number of words to make password\n        -i, --interactive\n                                    Interactively select a password\n        -v VALID_CHARS, --valid-chars=VALID_CHARS\n                                    Valid chars, using regexp style (e.g. '[a-z]')\n        -V, --verbose\n                                    Report various metrics for given options, including word list entropy\n        -a ACROSTIC, --acrostic=ACROSTIC\n                                    Acrostic to constrain word choices\n        -c COUNT, --count=COUNT\n                                    number of passwords to generate\n        -d DELIM, --delimiter=DELIM\n                                    separator character between words\n        -R, --random-delimiters\n                                    use randomised delimiters\n        -D DELIMITERS, --valid-delimiters=DELIMETERS\n                                    delimeters to choose from, used with -\n        -s SEP, --separator SEP\n                                    Separate generated passphrases with SEP.\n        -C CASE, --case CASE  \n                                    Choose the method for setting the case of each word in\n                                    the passphrase. Choices: ['alternating', 'upper',\n                                    'lower', 'random', 'capitalize', 'as-is'] (default: 'lower').\n        --allow-weak-rng     \n                                     Allow fallback to weak RNG if the system does not\n                                    support cryptographically secure RNG. Only use this if\n                                    you know what you are doing.\n\n\nWord lists\n==========\n\nSeveral word lists are provided with the package. The default, `eff-long`, was specifically designed by the EFF for `passphrase generation  \u003chttps://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases\u003e`_ and is licensed under `CC BY 3.0 \u003chttps://creativecommons.org/licenses/by/3.0/us/\u003e`_. As it was originally intended for use with Diceware ensure that the number of words in your passphrase is at least six when using it. Two shorter variants of that list, `eff-short` and `eff-special`, are also included. Please refer to the EFF documentation linked above for more information.\n\nThe original word list from `xkcdpass` versions earlier than 1.10.0 is also provided as a convenience, and is available under `legacy`. This word list is derived mechanically from `12Dicts \u003chttp://wordlist.aspell.net/12dicts/\u003e`_ by Alan Beale. It is the understanding of the author of ``xkcdpass`` that purely mechanical transformation does not imbue copyright in the resulting work. The documentation for the 12Dicts project at\nhttp://wordlist.aspell.net/12dicts/ contains the following dedication:\n\n..\n\n    The 12dicts lists were compiled by Alan Beale. I explicitly release them to the public domain, but request acknowledgment of their use.\n\nNote that the generator can be used with any word file of the correct format: a file containing one 'word' per line.  \n\nAdditional languages\n~~~~~~~~~~~~~~~~~~~~\n\n- Spanish: a modifed version of archive.umich.edu in the `/linguistics` directory. It includes ~80k words. Less than 5 char. and latin-like words were deleted using regex. This list is public domain, see `here \u003chttp://www.umich.edu/~archive/linguistics/00readme.txt\u003e`_.\n- Finnish: a modified version of the Institute for the Languages of Finland `XML word list \u003chttp://kaino.kotus.fi/sanat/nykysuomi/\u003e`_. Profanities and expressions containing spaces were removed using regex. The resulting list contains ~93k words. The list is published under GNU LGPL, EUPL 1.1 and CC-BY 3.0 licenses.\n- Italian: generated from dumps of the Italian-language Wikipedia, which is released under the Creative Commons Attribution-Share-Alike 3.0 licence.\n- German (ger-anlx): based on `this GPL v3 list \u003chttps://github.com/dassencio/langcmp/blob/master/wordlists/top10000de.txt\u003e`_. Single and double character words have been removed.\n- German (ger-long, ger-short): imported from `this repository \u003chttps://github.com/dys2p/wordlists-de\u003e`_. BSD-3 licenced.\n- German (eff_large_de_sample.wordlist): based on `this public domain dictionary \u003chttps://sourceforge.net/projects/germandict/\u003e`_. Converted to UTF-8 and randomly sampled to reduce file size.\n- Norwegian: a modified version of `Norsk Ordbank in Norwegian Bokmål 2005 \u003chttps://www.nb.no/sprakbanken/show?serial=oai%3Anb.no%3Asbr-5\u0026lang=en\u003e`_, 2018-06-28 update, which is released under the `CC-BY 4.0 license \u003chttps://creativecommons.org/licenses/by/4.0/\u003e`_. Regex has been used to alter the list for cleanup and removal of words with impractical characters. The resulting list contains ~137k words.\n- French: One cleaned version of `this list \u003chttps://packetstormsecurity.com/files/download/32007/french.gz\u003e`_ (public domain), and one filtered to remove potentially offensive words.\n- Portuguese: Converted variant of the LibreOffice / Firefox Portuguese dictionary (from `this link \u003chttps://raw.githubusercontent.com/titoBouzout/Dictionaries/master/Portuguese%20(European).dic\u003e`_. GPL and BSD licenced.\n- Swedish: a modified version of `Martin Lindhe's Swedish word list \u003chttps://github.com/martinlindhe/wordlist_swedish\u003e`_ (MIT license). Modifications also released under MIT license.\n\nAdditional language word lists are always welcome!\n\nUsing xkcdpass as an imported module\n====================================\n\nThe built-in functionality of ``xkcdpass`` can be extended by importing the module into python scripts. An example of this usage is provided in `example_import.py \u003chttps://github.com/redacted/XKCD-password-generator/blob/master/examples/example_import.py\u003e`_, which randomly capitalises the letters in a generated password. `example_json.py` demonstrates integration of xkcdpass into a Django project, generating password suggestions as JSON to be consumed by a Javascript front-end.\n\nA simple use of import::\n\n    from xkcdpass import xkcd_password as xp\n\n    # create a wordlist from the default wordfile\n    # use words between 5 and 8 letters long\n    wordfile = xp.locate_wordfile()\n    mywords = xp.generate_wordlist(wordfile=wordfile, min_length=5, max_length=8)\n\n    # create a password with the acrostic \"face\"\n    print(xp.generate_xkcdpassword(mywords, acrostic=\"face\"))\n\nWhen used as an imported module, `generate_wordlist()` takes the following args (defaults shown)::\n\n    wordfile=None,\n    min_length=5,\n    max_length=9,\n    valid_chars='.'\n\nWhile `generate_xkcdpassword()` takes::\n\n    wordlist,\n    numwords=6,\n    interactive=False,\n    acrostic=False,\n    delimiter=\" \"\n\n\nInsecure random number generators\n=================================\n`xkcdpass` uses crytographically strong random number generators where possible (provided by `random.SystemRandom()` on most modern operating systems). From version 1.7.0 falling back to an insecure RNG must be explicitly enabled, either by using a new command line variable before running the script::\n\n    xkcdpass --allow-weak-rng\n\nor setting the appropriate environment variable::\n\n    export XKCDPASS_ALLOW_WEAKRNG=1\n\n\nChangelog\n=========\n- **1.20.0** Improved German wordlists, addressed bugs in delimeter and word length checks\n- **1.19.9** Remove usage of deprecated `assertEquals` in tests\n- **1.19.8** Enables `python -m xkcdpass` usage\n- **1.19.7** Adds Swedish wordlist, improvements to test suite, improvements to setup.py (excludes examples from install) \n- **1.19.6** Fixes randomly failing unit test\n- **1.19.5** Adds \"as-is\" option for case\n- **1.19.4** Makes randomised delimiters behavior consistent with fixed delimeters\n- **1.19.3** Restore a randomly sampled version of eff_large_de wordlist \n- **1.19.2** Reduction in install size\n- **1.19.1** Improvements to help text, handle rare case where arguments lead to empty wordlist\n- **1.19.0** Initial support for multiple wordfiles\n- **1.18.2** fixes for README\n- **1.18.0** Added randomised delimiters\n\n\nLicense\n=======\nThis is free software: you may copy, modify, and/or distribute this work under the terms of the BSD 3-Clause license.\nSee the file ``LICENSE.BSD`` for details.\n","funding_links":[],"categories":["Python","Tools"],"sub_categories":["Satellite"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredacted%2FXKCD-password-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredacted%2FXKCD-password-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredacted%2FXKCD-password-generator/lists"}