npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

markov-pwgen

v2.2.0

Published

Markov chain password generator

Downloads

18

Readme

Build Status

Markov Chain Password Generator

Description

markov-pwgen is a JavaScript command-line utility leveraging Foswig.js and Piscina libraries to generate memorable passwords derived from a given word list.

If a word list is not specified during installation, then a list of words in the language of the default locale is fetched from Krypton's Word Lists. Languages oriented from right to left will be supported in a future release. If the default locale is not supported, then the word list /usr/share/dict/web2 is used if available, otherwise a list from Project Gutenberg is downloaded.

Changes in v2.2.0

  • Update transliterate option to match tr command when length of FROM and TO strings differ.
  • Add option, --truncate-set1, to preserve previous transliterate behavior.
  • Improve regex implementing capitalization (option --upperCase).
  • Improve error handling.
  • Update dependencies.
  • Add standard to devDependencies.

Changes in V2.1.5

  • Fix URLs of locale-based word lists.
  • Node v20 required for RegExp.prototype.unicodeSets.
  • Introduce locale support.

Synopsis

Usage: markov-pwgen OPTIONS
OPTIONS (defaults are random within the given range):
  --attemptsMax, -a N
           Fail after N attempts to generate chain (default: 100)
  --count, -c N
           Generate N hyphen-delimited passwords (default: [3, 4])
  --dictionary, -d
           Allow dictionary-word passwords (default: false)
  --help, -h
           Print this help, then exit.
  --lengthMin, -n N
           Minimum password length N (default: [4, 6])
  --lengthMax, -m N
           Maximum password length N (default: [7, 13])
  --order, -o N
           Markov order N (default: [3, 4])
  --transliterate, -t FROM,TO
           Replace in password characters of FROM with corresponding
           characters of TO.
  --truncate-set1, -s
           By default, transliteration string TO is extended to
           length of FROM by repeating its last character as necessary.
           This option first truncates FROM to length of TO.
  --upperCase, -u
           Capitalize password components.
  --version, -v
           Print version, then exit.
NB: Lower Markov order yields more random (i.e., less recognizable) words.

Installation

In the following, to use a non-default locale, prefix the install command with the desired locale, e.g., LANG=fr.

To install from the web, run on the command line:

npm install -g  markov-pwgen

Source Installation

To install from source, on the command line run:

git clone https://github.com/revolution-robotics/markov-pwgen
cd ./markov-pwgen

and if GNU make and JSON parser jq are available, run:

gmake install

Otherwise, run:

npm pack .
npm install -g ./markov-pwgen-2.2.0.tgz

MS Windows

Do not attempt to install markov-pwgen with PowerShell. If not already installed, follow the instructions: Install NodeJS on Windows. Unless using Windows Subsystem for Linux, install Git along with Node.js. Then, with Git-Bash running in Terminal, verify that node is in the command search path, e.g.:

export PATH=$PATH:'/c/Program Files/nodejs'

Now, markov-pwgen can be installed as described above.

Word List Update

Passwords are derived from a filtered version of a given word list. To filter and deploy an updated or alternative word list, a gmake target is provided in the markov-pwgen source:

gmake update-wordlist WORDLIST=/path-or-url/to/updated-wordlist

where /path-or-url/to/updated-wordlist is the given word list update.

To change the locale of the word list, use, e.g.:

LANG=fr gmake update-wordlist

Examples

markov-pwgen's default settings are sufficient for generating passwords that are secure yet memorable, e.g. the command:

for i in {1..10}; do
    markov-pwgen
done

might produce:

cowhead-coastis-identry
Amertab-pentation-leenwine
ergonic-Morchic-unsory-unicize
Centenant-theomalo-wintral
corest-gummless-banision
unadie-briliac-upporian-tobed
smiless-lernalled-repulla-prethic
tranship-waiveting-Hinduped
crustee-dolutered-zoozoop
octable-Amosed-instic-fibric

For shorter words, say, between 4 and 6 characters long, lowering the Markov order helps (at the expense of less "recognizable" words):

for i in {1..10}; do
    markov-pwgen -n 4 -m 6 -o 2
done

produces:

gagish-rewhic-subity-chmose
porogy-wairdy-owmate
nised-ectul-whess-scory
efulke-excale-psyced-trear
scrase-dreip-minbus
nomma-jary-porgue
hemet-imagge-mainch-Lyctor
tivion-wity-putsan
Myrlae-firism-kniong-hoodin
spolid-coeod-prodal

Command-line option --transliterate=FROM,TO replaces in the output letters of string FROM with corresponding letters of string TO. Command-line option --upperCase capitalizes each "word" component. Together, these options add more variation in the output. For instance, the command:

for i in {1..10}; do
    markov-pwgen -u -t'its,!7$'
done

might produce:

Furan7$-Beneface-Unance$
Vaccou$-Alvayne$$-$ub$eral-Boozener
Re7ragoe$-Hel!g!on-Dockey!ng
Ammone$-Malac7er-Encoax!n-Verneb
Hered$-Fluced-Coequee-Vo7e!ng
Azoc7a7e-Baboun7er-Federanx
M!lder-Kal!dae-Arch!n!
Febr!d!ne-Econqu!r!ng-Paper$ed-$udor!f!d
Unwrongyl-Cyclo7hurl-Fam!l!7e
Unf!l!zed-Bu$7he$-Predoneure

Bugs

If you feel that markov-pwgen could be improved, please consider creating an issue at: markov-pwgen issues.