Add greater time spans in display, Add 1e12 guess metric #228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add larger time spans
The textual feedback (
result.crack_times_display
) on times stops at centuries. Considering Moore's law and assuming guessing speed progresses proportionally, a century long password today will take 3 years in a decade and 35 days in two decades.In that vein, I added millennium (1000 years) its associated pluralization. If a password exceeds 1000 millennia in guessing time (a million years), then the returned value is ">1000 millennia". This draws a better distinction between currently-strong passwords and forever-strong passwords.
Add 1e12 guesses
Leaving guess counts at 1e10 seems a little optimistic, considering we know of organizations with the ability to guess a trillion or more times a second (the README says as much) and home-made rigs have long since broken 330GH using Hashcat. As such, I added 1e12 guesses to the result for more enthusiastic password security.
Why should this matter?
Note that if the two points made above are combined (exponential growth in guessing power and underestimation of guessing power), the following conclusions can be made:
Concerns about scope
I understand if this seems unnecessary to the scope of the project.
This change is very small. If it's deemed unnecessary to merge it, I'm fine with keeping it that way.
Testing
This code makes no changes to the way zxcvbn works, it only adds to the textual output.
As such,
npm test
passes all 1027 tests.