zxcvbn 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +35 -35
- data/lib/zxcvbn/scoring.rb +4 -1
- data/lib/zxcvbn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50df44a0d9bdff1e7b99f5ef1fac71d95a5bc23bf1d01d302bd23a8d6e027d1e
|
4
|
+
data.tar.gz: 4f7c36d4c57b193b72b4964e002931cf665851b8bfb13ccfd7b0f7ea74773840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7210bdcd7b53a785cdc046b6886ba99f02da09905638eacf4f8acbebbd7c3f4e57121f9bf9e49650c2aae2c1b1a782bc7736edfc378ca40d2a5082ce4682133d
|
7
|
+
data.tar.gz: 600e750ee98acd0c1fa070cdf7144324165a894eb42eeff336e5e59d57be8e8c08fe06f9bb70ef5827208077febe0039783d5ef16aecde2eb4458fffa7594eaa
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,45 +24,45 @@ Or install it yourself as:
|
|
24
24
|
```
|
25
25
|
Zxcvbn.zxcvbn("password")
|
26
26
|
=> {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
"password" => "password",
|
28
|
+
"guesses" => 3,
|
29
|
+
"guesses_log10" => 0.47712125471966244,
|
30
|
+
"sequence" => [
|
31
31
|
{
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
32
|
+
"pattern" => "dictionary",
|
33
|
+
"i" => 0,
|
34
|
+
"j" => 7,
|
35
|
+
"token" => "password",
|
36
|
+
"matched_word" => "password",
|
37
|
+
"rank" => 2,
|
38
|
+
"dictionary_name" => "passwords",
|
39
|
+
"reversed" => false,
|
40
|
+
"l33t" => false,
|
41
|
+
"base_guesses" => 2,
|
42
|
+
"uppercase_variations" => 1,
|
43
|
+
"l33t_variations" => 1,
|
44
|
+
"guesses" => 2,
|
45
|
+
"guesses_log10" => 0.3010299956639812
|
46
46
|
}
|
47
47
|
],
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
48
|
+
"calc_time" => 1,
|
49
|
+
"crack_times_seconds" => {
|
50
|
+
"online_throttling_100_per_hour" => 108.0,
|
51
|
+
"online_no_throttling_10_per_second" => 0.3,
|
52
|
+
"offline_slow_hashing_1e4_per_second" => 0.0003,
|
53
|
+
"offline_fast_hashing_1e10_per_second" => 3.0e-10},
|
54
|
+
"crack_times_display" => {
|
55
|
+
"online_throttling_100_per_hour" => "2 minutes",
|
56
|
+
"online_no_throttling_10_per_second" => "less than a second",
|
57
|
+
"offline_slow_hashing_1e4_per_second" => "less than a second",
|
58
|
+
"offline_fast_hashing_1e10_per_second" => "less than a second"
|
54
59
|
},
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
:score => 1,
|
62
|
-
:feedback =>
|
63
|
-
{
|
64
|
-
:warning => "This is a very common password",
|
65
|
-
:suggestions => ["Add another word or two. Uncommon words are better."]
|
60
|
+
"score" => 0,
|
61
|
+
"feedback" => {
|
62
|
+
"warning" => "This is a top-10 common password",
|
63
|
+
"suggestions" => [
|
64
|
+
"Add another word or two. Uncommon words are better."
|
65
|
+
]
|
66
66
|
}
|
67
67
|
}
|
68
68
|
```
|
data/lib/zxcvbn/scoring.rb
CHANGED
@@ -125,6 +125,10 @@ module Zxcvbn
|
|
125
125
|
optimal["g"][k][l] = g
|
126
126
|
optimal["m"][k][l] = m
|
127
127
|
optimal["pi"][k][l] = pi
|
128
|
+
|
129
|
+
optimal["g"][k] = optimal["g"][k].sort.to_h
|
130
|
+
optimal["m"][k] = optimal["m"][k].sort.to_h
|
131
|
+
optimal["pi"][k] = optimal["pi"][k].sort.to_h
|
128
132
|
end
|
129
133
|
|
130
134
|
# helper: make bruteforce match objects spanning i to j, inclusive.
|
@@ -148,7 +152,6 @@ module Zxcvbn
|
|
148
152
|
# leads to new bests.
|
149
153
|
m = make_bruteforce_match.call(i, k)
|
150
154
|
optimal["m"][i - 1].each do |l, last_m|
|
151
|
-
l = l.to_i
|
152
155
|
# corner: an optimal sequence will never have two adjacent bruteforce matches.
|
153
156
|
# it is strictly better to have a single bruteforce match spanning the same region:
|
154
157
|
# same contribution to the guess product with a lower length.
|
data/lib/zxcvbn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zxcvbn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby port of Dropbox's zxcvbn.js
|
14
14
|
email:
|