Coder Social home page Coder Social logo

akrawchyk / hardpass Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 0.0 598 KB

Lightweight password strength checker that enforces a strong password policy.

Home Page: https://codesandbox.io/s/hardpass-hook-example-o14c2

License: MIT License

TypeScript 87.95% JavaScript 12.05%
password passwords zxcvbn password-strength

hardpass's Introduction

hardpass npm CircleCI

Lightweight password strength checker that enforces a strong password policy.

features

install

npm install hardpass --save

# or with yarn

yarn add hardpass

usage

const hardpass = require('hardpass');

hardpass('qwerty123');
/*
{
  score: 0,
  feedback: {
    warning: 'Not complex enough',
    suggestions: [
      'Try adding at least 1 upper case character',
      'Try adding at least 1 special character',
      'Must be at least 10 characters long'
    ]
  }
}
*/

hardpass('Cm;cF*1f5L');
/*
{
  score: 4
}
*/

policy

Inspired by OWASP Proper Password Strenth Controls.

implemented

  • Password length
    • at least 10 characters
    • at most 128 characters
  • Password complexity
    • at least 3 of:
      • at least 1 uppercase character (A-Z)
      • at least 1 lowercase character (a-z)
      • at least 1 digit (0-9)
      • at least 1 special character (punctuation) โ€” !"#$%&'()*+,-./:;<=>?@[\\\]^_\{|}~`
    • not more than 2 identical characters in a row (e.g., 111 not allowed)
  • Password topologies
  • Feedback messages

planned

  • Configurable feedback messages
  • Configurable password dictionaries

motivation

zxcvbn.js bundled and minified is about 400kB gzipped or 820kB uncompressed, most of which is dictionaries.[link]

We can eliminate the majority of weak passwords by enforcing baseline recommended security policies for strong passwords.

We can prune common password dictionaries to reduce their footprint as well, and provide different configurations for file-size tradeoffs.

license

MIT ยฉ Andrew Krawchyk

hardpass's People

Contributors

akrawchyk avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.