Socket
Book a DemoInstallSign in
Socket

not-pwned

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

not-pwned

Check if your password has been pwned

0.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

not-pwned

npm (scoped) Travis Coveralls

Check if your password has been pwned

It uses have i been pwned? to verify if a password has appeared in a data breach. In order to protect the value of the source password being searched the value is not sended through the network. Instead it uses a k-Anonymity model that allows a password to be searched for by partial hash. This allows the first 5 characters of a SHA-1 password hash to be passed to the API. Then this lib search the results of the response for the presence of their source hash and if not found, the password does not exist in the data set.

Table of Contents

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

$ npm install --save not-pwned

The UMD build is also available on jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/not-pwned/dist/not-pwned-browser.min.js"></script>

You can find the library on window.notPwned.

Usage

import notPwned from 'not-pwned'

notPwned('somepassword').then(answer => {
  if (answer === true) {
    console.log('Good news — no pwnage found! This password wasn\'t found in any of the Pwned Passwords loaded into Have I been pwned.')
  } else {
    console.log('Ohh, sorry! This password has previously appeared in a data breach and should never be used.')
  }
})

API

Table of Contents

notPwned

Check if a password was pwned.

Parameters

  • password string The password to check.

Returns Promise<boolean> returns true if the password was not pwned.

Contributing

See the contributing file.

License

Apache License, Version 2.0 © Thiago Santos

Keywords

password

FAQs

Package last updated on 25 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.