Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/commenthol/is-password-pwned
Check password against pwnedpasswords.com using k-anonimity model
https://github.com/commenthol/is-password-pwned
k-anon password passwords pwned-passwords pwnedpasswords security
Last synced: about 1 month ago
JSON representation
Check password against pwnedpasswords.com using k-anonimity model
- Host: GitHub
- URL: https://github.com/commenthol/is-password-pwned
- Owner: commenthol
- Created: 2018-08-12T06:18:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-06T19:34:12.000Z (over 2 years ago)
- Last Synced: 2024-11-07T23:56:09.617Z (about 2 months ago)
- Topics: k-anon, password, passwords, pwned-passwords, pwnedpasswords, security
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# is-password-pwned
> Check password against pwnedpasswords.com using k-anonimity model
[![NPM version](https://badge.fury.io/js/is-password-pwned.svg)](https://www.npmjs.com/package/is-password-pwned/)
[![Build Status](https://app.travis-ci.com/commenthol/is-password-pwned.svg?branch=master)](https://app.travis-ci.com/commenthol/is-password-pwned)See [Searching pwned passwords by range][].
Caches all found hashes in LRU cache.Runs in node and modern browsers.
## CLI
For using from the command line
```bash
$ npm i -g is-password-pwned
$ pwned
```## API
### constructor
**Parameters**
- `size` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** size of lru cache (optional, default `10000`)
**Examples**
```javascript
import Pwnd from 'is-password-pwned'const pwnd = new Pwnd()
const num = await pwnd.get('nutella')
//> num = 20833
```### get
get password from lru cache or request it from pwnedpasswords.com
if `num === undefined` password hash could not be found in pwnedpasswords.com**Parameters**
- `password` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** password to verify
Returns **await {Number}** num - number of found hashes
## Installation
Requires [nodejs](http://nodejs.org/).
```sh
$ npm install is-password-pwned
```## Tests
```sh
$ npm test
```## License
Unlicense https://unlicense.org
## References
- [Searching pwned passwords by range][]
[Searching pwned passwords by range]: https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange