这是 zxcvbn 的 java 端口, zxcvbn 是一个 JavaScript 密码强度生成器。
This is a Java version of zxcvbn, a password strength estimator originally written in JavaScript and inspired by password cracking tools. It uses pattern matching and conservative estimation to assess the strength of passwords. It can identify and evaluate the strength of over 30,000 common passwords, as well as common names and surnames based on US census data. It also recognizes popular English words from Wikipedia, US television shows, and movies. Additionally, it can detect other common password patterns such as dates, repeated characters (aaa), sequences (abcd), keyboard patterns (qwertyuiop), and l33t speak.
Related articles:
| Ported Version | Original zxcvbn Version |
|---|---|
| 1.2.3 - latest | 4.4.2 |
| 1.2.1 - 1.2.2 | 4.4.1 |
| 1.1.0 - 1.2.0 | 4.4.0 |
| 1.0.0 - 1.0.2 | 4.2.0 |
https://central.sonatype.com/artifact/com.nulab-inc/zxcvbn/1.9.0
Gradle:
compile 'com.nulab-inc:zxcvbn:1.9.0'Maven:
com.nulab-inc
zxcvbn
1.9.0
$ git clone https://github.com/nulab/zxcvbn4j.git
$ cd ./zxcvbn4j
$ ./gradlew build # build
$ ./gradlew test # test
$ ./gradlew jmh # benchmarkThis is also available Android.
Zxcvbn zxcvbn = new Zxcvbn();
Strength strength = zxcvbn.measure("This is password");If you want to add your own dictionary, put the keyword list of List type to the second argument.
List sanitizedInputs = new ArrayList();
sanitizedInputs.add("nulab");
sanitizedInputs.add("backlog");
sanitizedInputs.add("cacoo");
sanitizedInputs.add("typetalk");
Zxcvbn zxcvbn = new Zxcvbn();
Strength strength = zxcvbn.measure("This is password", sanitizedInputs);The return result is "Strength". It's almost the same as zxcvbn.
…Defined Key and the message in the properties file. Reference the messages.properties.
Strength strength = zxcvbn.measure(password);
Feedback feedback = strength.getFeedback();
Map messages = new HashMap<>();
messages.put(Locale.JAPANESE, ResourceBundle.getBundle("This is bundle name", Locale.JAPANESE));
messages.put(Locale.ITALIAN, ResourceBundle.getBundle("This is bundle name", Locale.ITALIAN));
Feedback replacedFeedback = feedback.replaceResourceBundle(messages);For bugs, questions and discussions please use the GitHub Issues.
MIT License
暂无开放 Issues,或尚未同步最近议题。