https://github.com/codetheweb/zxcvbn
Meteor wrapper for Dropbox's zxcvbn
https://github.com/codetheweb/zxcvbn
Last synced: 29 days ago
JSON representation
Meteor wrapper for Dropbox's zxcvbn
- Host: GitHub
- URL: https://github.com/codetheweb/zxcvbn
- Owner: codetheweb
- Created: 2015-11-02T21:21:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-03T23:12:32.000Z (almost 9 years ago)
- Last Synced: 2025-02-05T17:38:31.519Z (3 months ago)
- Language: JavaScript
- Homepage: https://atmospherejs.com/codetheweb/zxcvbn
- Size: 703 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wrapper for Dropbox's [zxcvbn](https://github.com/dropbox/zxcvbn)
[](https://travis-ci.org/codetheweb/zxcvbn)# This is no longer maintained!
Meteor now supports [installing directly from npm packages](http://info.meteor.com/blog/announcing-meteor-1.3).
Install the npm-packaged version of zxcvbn with `npm install zxcvbn`, then import and use it just like any other npm package.## Install
``` shell
meteor add codetheweb:zxcvbn
```## Usage
### (See the offical [docs](https://github.com/dropbox/zxcvbn/blob/master/README.md))
``` javascript
zxcvbn(password, user_inputs=[])
````zxcvbn()` takes one required argument, a password, and returns a result object with several properties:
``` coffee
result.guesses # estimated guesses needed to crack password
result.guesses_log10 # order of magnitude of result.guessesresult.crack_time_seconds # dictionary of back-of-the-envelope crack time
# estimations, in seconds, based on a few scenarios:
{
# online attack on a service that ratelimits password auth attempts.
online_throttling_100_per_hour# online attack on a service that doesn't ratelimit,
# or where an attacker has outsmarted ratelimiting.
online_no_throttling_10_per_second# offline attack. assumes multiple attackers,
# proper user-unique salting, and a slow hash function
# w/ moderate work factor, such as bcrypt, scrypt, PBKDF2.
offline_slow_hashing_1e4_per_second# offline attack with user-unique salting but a fast hash
# function like SHA-1, SHA-256 or MD5. A wide range of
# reasonable numbers anywhere from one billion - one trillion
# guesses per second, depending on number of cores and machines.
# ballparking at 10B/sec.
offline_fast_hashing_1e10_per_second
}result.crack_time_display # same keys as result.crack_time_seconds,
# with friendlier display string values:
# "less than a second", "3 hours", "centuries", etc.result.score # Integer from 0-4 (useful for implementing a strength bar)
0 # too guessable: risky password. (guesses < 10^3)
1 # very guessable: protection from throttled online attacks. (guesses < 10^6)
2 # somewhat guessable: protection from unthrottled online attacks. (guesses < 10^8)
3 # safely unguessable: moderate protection from offline slow-hash scenario. (guesses < 10^10)
4 # very unguessable: strong protection from offline slow-hash scenario. (guesses >= 10^10)
result.feedback # verbal feedback to help choose better passwords. set when score <= 2.
result.feedback.warning # explains what's wrong, eg. 'this is a top-10 common password'.
# not always set -- sometimes an empty stringresult.feedback.suggestions # a possibly-empty list of suggestions to help choose a less
# guessable password. eg. 'Add another word or two'result.sequence # the list of patterns that zxcvbn based the
# guess calculation on.result.calc_time # how long it took zxcvbn to calculate an answer,
# in milliseconds.
````The optional `user_inputs` argument is an array of strings that zxcvbn will treat as an extra dictionary. This can be whatever list of strings you like, but is meant for user inputs from other fields of the form, like name and email. That way a password that includes a user's personal information can be heavily penalized. This list is also good for site-specific vocabulary — Acme Brick Co. might want to include ['acme', 'brick', 'acmebrick', etc].