GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dropbox/zxcvbn-ios: A realistic password strength estimator.

BranchesTags
Open more actions menu

Latest commit

 

History

65 Commits
65 Commits

Folders and files

NameName
Last commit message
Last commit date
Example
Example
 
 
Zxcvbn.xcodeproj
Zxcvbn.xcodeproj
 
 
Zxcvbn
Zxcvbn
 
 
ZxcvbnTests
ZxcvbnTests
 
 
iOS Example.xcodeproj
iOS Example.xcodeproj
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
zxcvbn-example.png
zxcvbn-example.png
 
 
zxcvbn-ios.podspec
zxcvbn-ios.podspec
 
 

Repository files navigation

.................................................bbb....................
.zzzzzzzzzz..xxx....xxx....cccccccc..vvv....vvv..bbb.........nnnnnnn....
.....zzzz......xxxxxx....cccc........vvv....vvv..bbbbbbbb....nnn...nnn..
...zzzz........xxxxxx....cccc..........vvvvvv....bbb....bb...nnn...nnn..
.zzzzzzzzzz..xxx....xxx....cccccccc......vv......bbbbbbbb....nnn...nnn..
........................................................................

An obj-c port of zxcvbn, a password strength estimation library, designed for iOS.

DBZxcvbn attempts to give sound password advice through pattern matching and conservative entropy calculations. It finds 10k common passwords, common American names and surnames, common English words, and common patterns like dates, repeats (aaa), sequences (abcd), and QWERTY patterns.

Check out the original JavaScript (well, CoffeeScript) or the Python port.

For full motivation, see zxcvbn: realistic password strength estimation.

Installation

Coming soon.

Use

The easiest way to use DBZxcvbn is by displaying a DBPasswordStrengthMeter in your form. Set up your UITextFieldDelegate and add a DBPasswordStrengthMeter.

See the example here: DBCreateAccountViewController.m

As the user types, you can call scorePassword: like so:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    NSString *password = [textField.text stringByReplacingCharactersInRange:range withString:string];

    [self.passwordStrengthMeterView scorePassword:password];

    return YES;
}

Here is what DBPasswordStrengthMeter looks like in a form:

To use DBZxcvbn without the DBPasswordStrengthMeter view simply import DBZxcvbn.h, create a new instance of DBZxcvbn, then call passwordStrength:userInputs:.

#import <Zxcvbn/DBZxcvbn.h>

DBZxcvbn *zxcvbn = [[DBZxcvbn alloc] init];
DBResult *result = [zxcvbn passwordStrength:password userInputs:userInputs];

The DBResult includes a few properties:

result.entropy          // bits

result.crackTime        // estimation of actual crack time, in seconds.

result.crackTimeDisplay // same crack time, as a friendlier string:
                        // "instant", "6 minutes", "centuries", etc.

result.score            // [0,1,2,3,4] if crack time is less than
                        // [10**2, 10**4, 10**6, 10**8, Infinity].
                        // (useful for implementing a strength bar.)

result.matchSequence    // the list of patterns that zxcvbn based the
                        // entropy calculation on.

result.calcTime         // how long it took to calculate an answer,
                        // in milliseconds. usually only a few ms.

The optional userInputs argument is an array of strings that DBZxcvbn will add to its internal 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 the user's personal info can be heavily penalized. This list is also good for site-specific vocabulary.

Acknowledgments

Thanks to Dropbox for supporting independent projects and open source software.

A huge thanks to Dan Wheeler for the original CoffeeScript implementation. Thanks to Ryan Pearl for his Python port. I've enjoyed copying your code :)

Echoing the acknowledgments from earlier libraries...

Many thanks to Mark Burnett for releasing his 10k top passwords list:

http://xato.net/passwords/more-top-worst-passwords

and for his 2006 book, "Perfect Passwords: Selection, Protection, Authentication"

Huge thanks to Wiktionary contributors for building a frequency list of English as used in television and movies: http://en.wiktionary.org/wiki/Wiktionary:Frequency_lists

Last but not least, big thanks to xkcd :) https://xkcd.com/936/

About

A realistic password strength estimator.

tech.dropbox.com/2012/04/zxcvbn-realistic-password-strength-estimation/

Resources

Readme
MIT license
Activity
Custom properties

Stars

221 stars

Watchers

22 watching

Forks

65 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.