Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattt/Navajo
Password Validator & Strength Evaluator
https://github.com/mattt/Navajo
Last synced: 3 months ago
JSON representation
Password Validator & Strength Evaluator
- Host: GitHub
- URL: https://github.com/mattt/Navajo
- Owner: mattt
- License: mit
- Archived: true
- Created: 2014-03-03T21:51:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-06-13T16:36:10.000Z (over 5 years ago)
- Last Synced: 2024-07-18T06:43:43.215Z (4 months ago)
- Language: Objective-C
- Homepage:
- Size: 63.5 KB
- Stars: 833
- Watchers: 18
- Forks: 52
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Navajo
**Password Validator & Strength Evaluator**
> This library is no longer maintained.
> Use [Password Autofill Rules](https://developer.apple.com/documentation/security/password_autofill/customizing_password_autofill_rules)
> in iOS 12, macOS Mojave, and Safari
> to generate strong random passwords
> according to your own validation criteria.![Navajo](https://raw.github.com/mattt/Navajo/screenshots/example.gif)
> Navajo is named in honor of the famed [code talkers of the Second World War](http://en.wikipedia.org/wiki/Code_talker#Navajo_code_talkers).
## Usage
### Validating Password
```objective-c
NSString *password = @"abc123"
NJOPasswordValidator *validator = [NJOPasswordValidator standardValidator];NSArray *failingRules = nil;
BOOL isValid = [validator validatePassword:password
failingRules:&failingRules];if (!isValid) {
for (id 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](http://en.wikipedia.org/wiki/Entropy_%28information_theory%29).
```objective-c
NJOPasswordStrength strength = [NJOPasswordStrengthEvaluator strengthOfPassword:password];
NSLog(@"%@", [NJOPasswordStrengthEvaluator localizedStringForPasswordStrength:strength]);
```## License
MIT
## Contact
Mattt ([@mattt](https://twitter.com/mattt))