ZXCVBN 1.0.5

ZXCVBN 1.0.5

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2015

Maintained by Gabriel Handford.



ZXCVBN 1.0.5

  • By
  • John Johnson

This is the ZXCVBN password strength estimation in Obj-C.

The origin version of ZXCVBN was a coffee script version. But this code was based on the python version by Ryan Pearl. The JSON generator in tools/ also comes from the python version.

Please refer to the Dropbox Blog article for the full details and motivation behind zxcbvn.

Install

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects.

Podfile

platform :ios, '7.0'
pod "ZXCVBN"

Password Strength

#import <ZXCVBN/BBPasswordStrength.h>

BBPasswordStrength *strength = [[BBPasswordStrength alloc] initWithPassword:@""];
[strength score]; // 0
[strength entropy]; // 0.0
[strength scoreLabel]; // Very Weak
[strength crackTimeDisplay]; // no time

BBPasswordStrength *strength = [[BBPasswordStrength alloc] initWithPassword:@"zxcvbn"];
[strength score]; // 0
[strength entropy]; // 6.845
[strength scoreLabel]; // Very Weak
[strength crackTimeDisplay]; // no time

BBPasswordStrength *strength = [[BBPasswordStrength alloc] initWithPassword:@"qwER43@!"];
[strength score]; // 1
[strength entropy]; // 26.44
[strength scoreLabel]; // Weak
[strength crackTimeDisplay]; // 39 minutes

BBPasswordStrength *strength = [[BBPasswordStrength alloc] initWithPassword:@"Tr0ub4dour&3"];
[strength score]; // 2
[strength entropy]; // 30.435
[strength scoreLabel]; // So-so
[strength crackTimeDisplay]; // 11 hours

BBPasswordStrength *strength = [[BBPasswordStrength alloc] initWithPassword:@"correcthorsebatterystaple"];
[strength score]; // 4
[strength entropy]; // 45.212
[strength scoreLabel]; // Great!
[strength crackTimeDisplay]; // 64 years