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

genpasswd

v0.2.3

Published

Password generator

Downloads

202

Readme

Generate strong random passwords from CLI.

Usage (CLI)

The usage is very simple, by default the command generate a password with 15[0] characters length, using letters, numbers and symnbols:

$ genpasswd 
h8d=1Cs<;V}[Az/

You can see all options using:

$ genpasswd --help

Passwords types

Passwords types is a easy way to generate a specific format password, There are:

  • alpha: Alphabetics chars (only letters, from a to z)
  • alphanumeric: Alphabetics chars with numbers
  • numeric: Only numbers
  • symbols: Symbols like #, !, etc.
  • complex: Use a mix of Alphanumerics and symbols
  • custom: Yo can set what groups of chars and add chars with --chars
  • binary: Binary output (for keys usages)

This list can be showed using

$ genpasswd --types

By default, genpasswd use complex, you can use custom combined with selected types, for example:

$ genpasswd -l 30 -t custom --numeric --symbols 
:`:73(;%}6{=!;452?//~@$??7+1^=

This return a password generated with numbers and symbols, you can set specific chars to, and combine:

$ genpasswd -l 30 -t custom --chars abcDEF123
1c2bcF2baaab2EF2F31aDFD32Ec31a
$genpasswd -l 30 -t custom --chars abcDEF --numeric
ac29b9863210F57Dc87Fc922ba92aa

Deterministic passwords

You can generate deterministic passwords based in thre variables; a phrasepass, a salt and an iterations number, the interations are set on 1000 by default, but the phrasepass and salt are requried.

This funcions allow you to generate strong passwords for services based on two (or three) memorizables seeds.

For example, if you can set a strong password to you email account, you can use the addres as phrasepass and a simple password as the salt, for example:

$ genpasswd -d -l 30
genpass: phrasepass:  <- here you write you address ([email protected])
genpass: salt:  <- here your every day password (coldplay2012$) 
fQz":Jib&7H,d}W6j+sA{)jnS~}u]3"

Ever you use a deterministic algorithm to generate a password (with this utility) the password will be identical. You can generate it whenever you need it. The internal algorithm used to generate the password is PBKDF2.

The advantage of using as phrasepass the account name, is that you can have a different password for each service.

Symetric key generation

For symetric binary key generation, there are a binary type, it works like a simple random generator like dd if=/dev/random, but with the posibility of generate a deterministic binary keys.

For example, if you need to generate a LUKS key, you need a 4096B binary blob. With DD it's:

$ dd if=/dev/random of=disk.key bs=1024 count=4

With genpasswd can be:

$ genpasswd -bl 4096 -o disk.key 

Normally you need to backup this type of keys, but with the deterministic method, you can generate it with a password/salt schema and only remember it like a standar password.

$ genpasswd -dbl 4096 --100k -o disk.key

This generate a deterministic key with a 100,000 iterations.

Install

With npm :

$ sudo npm install genpasswd

From sources

$ git clone https://github.com/exos/genpasswd.git
$ npm install -d 

Use (as node module)

$ npm install --save genpasswd

In your code:


var genPasswd = require('genpasswd');

var options = {
    type: genPasswd.password.TYPE_COMPLEX,
    passwordLength: 30
};

genPasswd.password.generate(options, function (err, password) {
    // password is a string
});

You can see more details on the wiki

Support

You can:

  • Report bugs or ideas in the tracker
  • Fork and send pull request with bug fixeds/new features
  • Spellcheck (My english is horrible)
  • Donate BTC: 1E9A4Jg1tckJGD8rUx1WogBEL7uPXAktNP

0- The 15 length password by default is because 15 chars is a better option (no best), based on stadistics makes for me