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

password-analyzer

v0.0.3

Published

Passwords Analyzer is an API developed to aid in analysis of password lists

Downloads

7

Readme

Build Status npm version Code Climate Test Coverage

Password Analyzer

Passwords Analyzer is an API developed to aid in analysis of password lists.

It allows to analyze existing passwords and based on the analysis system password requirements can be changed (say, increase minimum password length or password complexity by requiring special characters) in order to improve system security.

Usage

var analyzer = require('password-analyzer');
var passwordAnalyzer = new analyzer.PasswordAnalyzer();

// Setup groups and analyzers for each group
passwordAnalyzer.addGroup('Character sets', ['numeric', 'loweralpha', 'upperalpha']);
passwordAnalyzer.addGroup('Months', ['months']);

// Sample passwords
var passwords = [ '123456', 'abcdef', 'foobar', 'ABC', 'January' ];
passwords.forEach(passwordAnalyzer.analyze.bind(passwordAnalyzer));

// returns object with results of passwords analysis
passwordAnalyzer.getResults();

The addGroup function accepts two parameters:

  • a string specifying a group name - that name will appear in an analysis results object
  • an array or a single analyzer which can be:
    • a string representing a pre-defined analyzer code (you can find analyzer codes below)
    • an analyzer constructor (function) - a new analyzer will be instantiated using the given constructor
    • an analyzer instance

Example of password analysis results:

{
	total: 5, // total number of anlyzed passwords
	groups: [ // All analysis groups
	{
		// Group name
		name: 'Character sets', 

		// Analyzers for the given group
		analyzers:[
			// Analyzer code (id) and number of passwords matching rules of the given analyzer
			{ code: 'numeric', count: 1 },
			{ code: 'loweralpha', count: 2 },
			{ code: 'upperalpha', count: 1 }
		]
	}, { 
		name: 'Months', 
		analyzers: [ { code: 'january', count: 1 } ]
	}
]};

Available Analyzers

  • AllCharsAnalyzer - (code: all)
  • Analyzer - base analyzer - it is can be extended to create other more specialized analyzers
  • LowerAlphaAnalyzer - (code: loweralpha) checks if a password is composed of lowercase letters only
  • LowerAlphaNumAnalyzer - (code loweralphanum) checks if a password is composed of lowercase letters and numbers only
  • LowerAlphaSpecialAnalyzer - (code loweralphaspecial) checks if a password is composed of lowercase and special characters only
  • LowerAlphaSpecialNumAnalyzer - (code loweralphaspecialnum) checks if a password is composed of: lowercase, special and numbers only
  • MaskAnalyzer - checks if a passwords is matched by a specific mask (see details below)
  • MixedAlphaAnalyzer - (code: mixedalpha) checks if a password is composed of letters only
  • MixedAlphaNumAnalyzer - (code mixedalphanum) checks if a password is composed of upper and lowercase letters only
  • MixedAlphaSpecialAnalyzer - (code mixedalphaspecial) checks if a password is composed of: uppercase, lowercase and special characters only
  • MonthsAnalyzer - (code: months) checks if a password is composed of English month names (case insensitive) only
  • NumericAnalyzer - (code: numeric) checks if a password is composed of digits only
  • PasswordLengthAnalyzer - (code: length) performs password length analysis
  • RegexAnalyzer - regular expression analyzer - perform password analysis based on configured regular expressions (password matching)
  • SpecialAnalyzer - (code: special) checks if a password is composed of special characters only
  • SpecialNumAnalyzer - (code: specialnum) checks if a password is composed of digits and special characters only
  • UpperAlphaAnalyzer - (code: upperalpha) checks if a password is composed of capital letters only
  • UpperAlphaNumAnalyzer - (code: upperalphanum) checks if a password is composed of capital letters and digits only
  • UpperAlphaSpecialAnalyzer - (code: upperalphaspecial) checks if a password is composed of capital letters and special characters only
  • UpperAlphaSpecialNumAnalyzer - (code: upperalphaspecialnum) checks if a password is composed of: capital letters, special characters and digits only

MaskAnalyzer

Mask analyzer checks if a password is matched by a specific mask. The matching mask can be composed of letters and some masks as follows:

  • ?l - matches a single lowercase character
  • ?u - matches a single uppercase character
  • ?d - matches a single digit
  • ?s - matches a single special character i.e. one of: !"#$%&'()*+,-./:;<=>?@[\]^_``{|}~«space»
  • ?a - matches any single characters i.e. ?l or ?u or ?d or ?s

So a password like this foo123 would be matched by the following mask: ?l?l?l?d?d?d.

Author

Written by Tom Pawlak - Blog

License

Copyright (c) 2014 Tom Pawlak

MIT License : https://blog.abelotech.com/mit-license/