Entropy strength measured using zxcvbn

This commit is contained in:
Ian Coleman
2016-11-10 21:34:15 +11:00
parent 439f0e252b
commit b299a6a722
3 changed files with 40 additions and 0 deletions

View File

@@ -559,6 +559,7 @@
<script src="js/wordlist_french.js"></script>
<script src="js/wordlist_italian.js"></script>
<script src="js/jsbip39.js"></script>
<script src="js/zxcvbn.js"></script>
<script src="js/entropy.js"></script>
<script src="js/index.js"></script>
</body>

View File

@@ -804,6 +804,17 @@
if (entropy.binaryStr.length >= 192) {
strength = "extremely strong";
}
// If time to crack is less than one day, and password is considered
// strong or better based on the number of bits, rename strength to
// 'easily cracked'.
var z = zxcvbn(entropy.cleanStr);
var timeToCrack = z.crack_times_seconds.offline_fast_hashing_1e10_per_second;
if (timeToCrack < 86400 && entropy.binaryStr.length >= 128) {
strength = "easily cracked";
if (z.feedback.warning != "") {
strength = strength + " - " + z.feedback.warning;
};
}
var bitsStr = entropy.binaryStr.length;
if (entropy.base.asInt != 2) {
bitsStr += " (" + entropy.binaryStr + ")";

28
src/js/zxcvbn.js Normal file

File diff suppressed because one or more lines are too long