Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.
/ Navajo Public archive

Password Validator & Strength Evaluator

License

Notifications You must be signed in to change notification settings

mattt/Navajo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Navajo

Password Validator & Strength Evaluator

This library is no longer maintained. Use Password Autofill Rules in iOS 12, macOS Mojave, and Safari to generate strong random passwords according to your own validation criteria.

Navajo

Navajo is named in honor of the famed code talkers of the Second World War.

Usage

Validating Password

NSString *password = @"abc123"
NJOPasswordValidator *validator = [NJOPasswordValidator standardValidator];

NSArray *failingRules = nil;
BOOL isValid = [validator validatePassword:password
                              failingRules:&failingRules];

if (!isValid) {
    for (id <NJOPasswordRule> rule in failingRules) {
        NSLog(@"- %@", [rule localizedErrorDescription]);
    }
}

Available Validation Rules

  • Allowed Characters
  • Required Characters (e.g. lowercase, uppercase, decimal, symbol)
  • Non-Dictionary Word
  • Minimum / Maximum Length
  • Predicate Match
  • Regular Expression Match
  • Block Evaluation

Evaluating Password Strength

Password strength is evaluated in terms of information entropy.

NJOPasswordStrength strength = [NJOPasswordStrengthEvaluator strengthOfPassword:password];
NSLog(@"%@", [NJOPasswordStrengthEvaluator localizedStringForPasswordStrength:strength]);

License

MIT

Contact

Mattt (@mattt)

About

Password Validator & Strength Evaluator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •