Simple password generator to quickly get a randomly generated secure password to your clipboard.
Requires Node.js 14+ and the Alfred Powerpack.
Via NPM:
npm i --global alfred-pwgen
Installing via NPM is the preferred method, you can however also download the alfred-password-generator.alfredworkflow
found under releases and add the workflow manually.
Type pw
to quickly generate a selection of passwords, if needed you may also supply the password length, for example pw 8
.
Select the password you want (with the arrow keys + enter, or cmd+1, cmd+2 etc.) and it will be copied to your clipboard.
4 types of passwords are always presented; letters+numbers+symbols
, letters+numbers
, only letters
and words
(xkcd-style).
Note, the first time you run
pw
in Alfred it may take a few seconds before a password shows up, this is due to the word-list is built and then cached for future use.
There are two workflow settings that you can adjust, defaultLength
(default: 20) and words
(default 4). defaultLength
sets the password length by simply typing pw
, and words
how many words are used to build word-based passwords.
You can change these defaults by selecting the workflow in Alfred and selecting "Configure workflow and variables".
In the output next by the generated password symbols are displayed for the estimated password entropy (in bits), they are:
◻◻◻◻
less than 26
◼◻◻◻
26-35
◼◼◻◻
36-59
◼◼◼◻
60-127
◼◼◼◼
128 or more
The default length of 20 should always output a password of an entropy of 128 or more (in the letters+numbers+symbols
variant).
Random numbers to generate the password uses the node crypto library, which in turn relies on the Javascript Crypto-APIs. This is much preferred over the traditional Math.random()
-methods which are not cryptographically secure (i.e. do not use password generators that use Math.random()
).
The words are selected from the word-list available on UNIX-systems at /usr/share/dict/words
, where all words between 3 and 6 characters in length are selected (~34000 words.)
This workflow is inspired by the great pwgen-workflow of which I have been a heavy user of for years, but sadly hasn't survived the port to macOS Monterey. This workflow focuses on the most common tasks however.
Uses alfy by Sindre Sorhus.
© 2022 – Marcus Olsson