Package: xkcd-phrase
xkcd-phraseA flexible and scriptable password generator which generates strong passphrases, inspired byXKCD 936.$ xkcd-phrase
Move Barbed Unplug HuskinessThis password generator is inspired byXKCD 936and the version provided byAdam BirdsWith the original code fromredacted/xkcd-password-generator.. The defaults have been configured in a way to give this tool the most compatibility out of the box with passphrase requirements and the flexibility to adjust for site specific requirements. The defaults provide:A phrase containing 4 words between 4 and 9 characters (The default wordfileeff-longonly contains words between 4 and 9 characters).The first letter of each word is capitalized.A seperator for human readability.This allows the phrase generator to provide phrases by default which will be strong, easy to remember, difficult to brute-force and still pass the usual requirements of at least one upper-case letter, one lower-case letter and a special character.Installxkcd-phrasecan easily be installed with the following command:pip install xkcd-phraseor manually by:python -m pip install <path><package>SourceThe source code can be foundhere.RequirementsPython 3 (Version 3.8 or later).Runningxkcd_phrasexkcd-phrasecan be called with no arguments with an output using the default wordfile and settings.$ xkcd-phrase
> Spiffy Deceit Unease PushoverThe default settings return a single phrase made up of 4 words each having: its first letter capitalized and spaces between the words for readability.It can also be called with a mixture of multiple arguments for example:$ xkcd-phrase -d _ -c 5 --min 5 --max 7 --numeric-char-num 4 --numeric-char-append
Cause_Resale_Moody_Arise6814
Suggest_Bundle_Cruelly_Suggest4674
Sleeve_Resort_Plastic_Drool5351
Hazily_Skimmed_Islamic_Gigolo6475
Salvage_Sphinx_Tightly_Banter9381This will return:-d _words joined by_.-c 55 passwords to choose from.--min 5 --max 7words between 5 and 7 characters long.--numeric-char-num 4Include 4 numerical characters in the passphrase.--numeric-char-appendInclude the numerics on the end of the passphrase.$ xkcd-phrase -V -n 6 --numeric-char-num 2 --special-char-num 2
The total possible number of symbol choices in the phrase is
77 possible symbols comprising:
        52 alphabetic characters
        10 numeric characters
        15 special characters

The phrase length is 53 with the entropy of the phrase is calculated as:
        log2(possible_symb (77) ^ phrase_len (53)) = 332.14

The phrase is: I)licit0y Dugout Reproduce Overfed De:al Sque3zeThis will return:-Vverbose output explaining the entropy of the passphrase.-n 6Use 6 words in the phrase.--numeric-char-num 2Include 2 numerical characters in the passphrase.--special-char-num 2Include 2 special characters in the passphrase..Note the default behaviour to substitute the numeric and special characters randonly into words.As an aide memoire, you can choose an acrostic for example:$ xkcd-phrase -a queen
> Quadrant Uncover Enforced Excretion NachoA full overview of the available options can be accessed by running following command:xkcd-phrase --helpBash-Completionxkcd-phrasealso supports bash-completion. To set this up you need to add the below to your.bashrcfile:eval "$(register-python-argcomplete xkcd-phrase)"This will then take effect the next time you login. To enable bash-completion immediately, you can run:source .bashrcWord ListsSeveral word lists are provided with the package. The default, eff-long, was specifically designed by the EFF forpassphrase generationand is licensed underCC BY 3.0. 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.Note thatxkcd-phrasecan be used with any word file of the correct format: a file containing one word per line.ChangelogVersion 1.0.0Initial ReleaseLicenseThis project is released under theGNU GENERAL PUBLIC LICENSE v3. However the original code fromredacted/xkcd-password-generatoris licensed under theBSD 3-Clause license.ContributingContributions welcome and gratefully appreciated!