password_strength 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +8 -6
- data/Gemfile +1 -1
- data/README.md +31 -5
- data/Rakefile +2 -0
- data/app/assets/javascripts/jquery_strength.js +10 -2
- data/app/assets/javascripts/password_strength.js +24 -3
- data/gemfiles/{ar_3_2.gemfile → am_3_2.gemfile} +1 -1
- data/gemfiles/{ar_4_0.gemfile → am_4_0.gemfile} +1 -1
- data/gemfiles/{ar_4_1.gemfile → am_4_1.gemfile} +1 -1
- data/gemfiles/am_4_2.gemfile +4 -0
- data/lib/password_strength/active_model.rb +1 -1
- data/lib/password_strength/base.rb +8 -0
- data/lib/password_strength/version.rb +2 -2
- data/package.json +11 -0
- data/password_strength.gemspec +2 -4
- data/support/common.txt +14 -14
- data/test/active_model_test.rb +2 -3
- data/test/password_strength_test.html +12 -34
- data/test/password_strength_test.js +321 -251
- data/test/password_strength_test.rb +8 -2
- data/test/test_helper.rb +14 -5
- data/test/user.rb +14 -1
- data/test/validators/windows2008_test.rb +1 -1
- metadata +11 -49
- data/Gemfile.lock +0 -64
- data/test/jquery-1.4.2.js +0 -6240
- data/test/jquery_strength_test.html +0 -43
- data/test/jquery_strength_test.js +0 -105
- data/test/jsunittest/jsunittest.js +0 -1017
- data/test/jsunittest/unittest.css +0 -54
- data/test/schema.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd2978e12b6d6980a1bdd21811b7804f417df7e
|
4
|
+
data.tar.gz: bcb325941e94e8885d0b01c12da7339ff3a6d733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b78bd8239f550d05f4afb26c517f3d90ef6f9c04ce1070201ed4dd35d55930a3efdacdaaed7187a2905eda1283f85d9482f326b3e87e76eef6d9d1077253d2b4
|
7
|
+
data.tar.gz: 6cae48bb42591bf3545e34f0296822fa710ba09e890edbea2c28d3d458fca284282033c766fabe13aa84875efbe49a69828e37bb7bbb09fe46c2e24af2d4da71
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
script: "bundle exec rake test"
|
3
|
-
|
3
|
+
sudo: false
|
4
4
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
5
|
+
- '2.2'
|
6
|
+
- '2.1'
|
7
|
+
- '2.0'
|
7
8
|
|
8
9
|
gemfile:
|
9
|
-
- gemfiles/
|
10
|
-
- gemfiles/
|
11
|
-
- gemfiles/
|
10
|
+
- gemfiles/am_3_2.gemfile
|
11
|
+
- gemfiles/am_4_0.gemfile
|
12
|
+
- gemfiles/am_4_1.gemfile
|
13
|
+
- gemfiles/am_4_2.gemfile
|
12
14
|
|
13
15
|
notifications:
|
14
16
|
email:
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
data/README.md
CHANGED
@@ -61,9 +61,9 @@ strength.valid?(:good)
|
|
61
61
|
#=> strength == :good or strength == :strong
|
62
62
|
```
|
63
63
|
|
64
|
-
## ActiveRecord
|
64
|
+
## ActiveRecord/ActiveModel
|
65
65
|
|
66
|
-
The PasswordStrength library comes with ActiveRecord support.
|
66
|
+
The PasswordStrength library comes with ActiveRecord/ActiveModel support.
|
67
67
|
|
68
68
|
```ruby
|
69
69
|
class Person < ActiveRecord::Base
|
@@ -71,6 +71,22 @@ class Person < ActiveRecord::Base
|
|
71
71
|
end
|
72
72
|
```
|
73
73
|
|
74
|
+
To be honest, you can use it with plain ActiveModel objects.
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
class Person
|
78
|
+
include ActiveModel::Model
|
79
|
+
validates_strength_of :password
|
80
|
+
end
|
81
|
+
|
82
|
+
# or simply
|
83
|
+
|
84
|
+
class Person
|
85
|
+
include ActiveModel::Validations
|
86
|
+
validates_strength_of :password
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
74
90
|
The default options are `:level => :good, :with => :username`.
|
75
91
|
|
76
92
|
If you want to compare your password against other field, you have to set the `:with` option.
|
@@ -97,9 +113,7 @@ You can also provide a custom class/module that will test that password.
|
|
97
113
|
validates_strength_of :password, :using => CustomPasswordTester
|
98
114
|
```
|
99
115
|
|
100
|
-
Your
|
101
|
-
going to override only the +test+ method that must call one of the following methods:
|
102
|
-
`invalid!`, `weak!`, `good!` or `strong!`.
|
116
|
+
Your `CustomPasswordTester` class should override the default implementation. In practice, you're going to override only the `test` method that must call one of the following methods: `invalid!`, `weak!`, `good!` or `strong!`.
|
103
117
|
|
104
118
|
```ruby
|
105
119
|
class CustomPasswordTester < PasswordStrength::Base
|
@@ -182,6 +196,18 @@ If you're using asset pipeline, just add the following lines to your `applicatio
|
|
182
196
|
//= require jquery_strength
|
183
197
|
```
|
184
198
|
|
199
|
+
## Running tests
|
200
|
+
|
201
|
+
### Ruby
|
202
|
+
|
203
|
+
1. Install all dependencies with `bundle install`.
|
204
|
+
2. Run `rake test`.
|
205
|
+
|
206
|
+
### JavaScript
|
207
|
+
|
208
|
+
1. Install Node.js, then run `npm install`.
|
209
|
+
2. Open `test/password_strength_test.html` in your target browser.
|
210
|
+
|
185
211
|
## License
|
186
212
|
|
187
213
|
(The MIT License)
|
data/Rakefile
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
(function(
|
1
|
+
(function(initializer) {
|
2
|
+
if (typeof(module) && module.exports) {
|
3
|
+
module.exports = initializer;
|
4
|
+
} else if (typeof(require) === "function" && require.amd) {
|
5
|
+
require(["password_strength", "jquery"], initializer);
|
6
|
+
} else {
|
7
|
+
initializer(window.PasswordStrength, window.jQuery);
|
8
|
+
}
|
9
|
+
}(function(PasswordStrength, $){
|
2
10
|
$.strength = function(username, password, options, callback) {
|
3
11
|
if (typeof(options) == "function") {
|
4
12
|
callback = options;
|
@@ -59,4 +67,4 @@
|
|
59
67
|
goodImage: "/images/good.png",
|
60
68
|
strongImage: "/images/strong.png"
|
61
69
|
});
|
62
|
-
})
|
70
|
+
}));
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
(function(){
|
2
2
|
var MULTIPLE_NUMBERS_RE = /\d.*?\d.*?\d/;
|
3
3
|
var MULTIPLE_SYMBOLS_RE = /[!@#$%^&*?_~].*?[!@#$%^&*?_~]/;
|
4
4
|
var UPPERCASE_LOWERCASE_RE = /([a-z].*[A-Z])|([A-Z].*[a-z])/;
|
5
5
|
var SYMBOL_RE = /[!@#\$%^&*?_~]/;
|
6
6
|
|
7
|
+
function escapeForRegexp(string) {
|
8
|
+
return string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
9
|
+
}
|
10
|
+
|
7
11
|
function PasswordStrength() {
|
8
12
|
this.username = null;
|
9
13
|
this.password = null;
|
@@ -21,6 +25,8 @@ var PasswordStrength = (function(){
|
|
21
25
|
this.status = "invalid";
|
22
26
|
} else if (this.usesCommonWord()) {
|
23
27
|
this.status = "invalid";
|
28
|
+
} else if (this.containInvalidRepetition()) {
|
29
|
+
this.status = "invalid";
|
24
30
|
} else {
|
25
31
|
score += this.scoreFor("password_size");
|
26
32
|
score += this.scoreFor("numbers");
|
@@ -181,6 +187,13 @@ var PasswordStrength = (function(){
|
|
181
187
|
return this.exclude.test(this.password.toString());
|
182
188
|
};
|
183
189
|
|
190
|
+
PasswordStrength.fn.containInvalidRepetition = function() {
|
191
|
+
var char = this.password[0];
|
192
|
+
var regex = new RegExp("^" + escapeForRegexp(char) + "+$", "i");
|
193
|
+
|
194
|
+
return regex.test(this.password);
|
195
|
+
};
|
196
|
+
|
184
197
|
PasswordStrength.fn.usesCommonWord = function() {
|
185
198
|
return PasswordStrength.commonWords.indexOf(this.password.toLowerCase()) >= 0;
|
186
199
|
};
|
@@ -264,7 +277,15 @@ var PasswordStrength = (function(){
|
|
264
277
|
return strength;
|
265
278
|
};
|
266
279
|
|
267
|
-
PasswordStrength.commonWords = ["!qaz1qaz", "!qaz2wsx", "!qaz2wsx", "!qazxsw2", "!qazzaq1", "#edc4rfv", "000000", "010203", "1111", "11111", "111111", "11111111", "112233", "1212", "121212", "123123", "1234", "12345", "123456", "1234567", "12345678", "123456789", "1234567890", "123qweasd", "12qw!@qw", "1313", "131313", "1941.salembbb.41", "1qaz!qaz", "1qaz@wsx", "1qazxsw@", "1qazzaq!", "2000", "2112", "2222", "232323", "2wsx@wsx", "3333", "3edc#edc", "4128", "4321", "4444", "5150", "5555", "555555", "654321", "6666", "666666", "6969", "696969", "7777", "777777", "7777777", "8675309", "987654", "@wsx2wsx", "aaaa", "aaaaaa", "aaliyah1", "abc123", "abc123abc", "abc123abc", "abcabc123", "abcabc123", "abcd1234", "abcdef", "abgrtyu", "abigail1", "access", "access14", "action", "addison1", "admin", "adobe123", "airforce1", "alabama1", "albert", "alex", "alexander1", "alexandra1", "alexis", "allison1", "amanda", "amateur", "america1", "anderson1", "andrea", "andrew", "angel", "angel101", "angel123", "angela", "angelina1", "angels", "animal", "annabelle1", "anthony", "anthony1", "anthony11", "antonio1", "apollo", "apple", "apples", "arianna1", "arsenal", "arsenal1", "arsenal12", "arsenal123", "arthur", "asdf", "asdfgh", "ashley", "ashley12", "asshole", "asshole1", "atlanta1", "august", "august08", "august10", "august12", "august20", "august22", "austin", "austin02", "austin316", "australia1", "awesome1", "azerty", "baby", "babyboy1", "babygirl1", "babygirl1", "babygurl1", "badboy", "bailey", "bailey12", "banana", "barcelona1", "barney", "baseball", "baseball1", "batista1", "batman", "beach", "bear", "beautiful1", "beaver", "beavis", "beckham7", "beer", "bella123", "benjamin1", "bentley1", "bethany1", "bigcock", "bigdaddy", "bigdaddy1", "bigdick", "bigdog", "bigtits", "bill", "billy", "birdie", "bitch", "bitches", "biteme", "black", "blazer", "blessed1", "blink-182", "blink182", "blonde", "blondes", "blondie1", "blowjob", "blowme", "blue", "bond007", "bonnie", "booboo", "boobs", "booger", "boomer", "booty", "boricua1", "boston", "bradley1", "brandon", "brandon1", "brandon2", "brandon7", "brandy", "braves", "braxton1", "brayden1", "brazil", "breanna1", "brian", "brianna1", "brittany1", "brittney1", "bronco", "broncos", "broncos1", "brooklyn1", "brownie1", "bubba", "bubbles1", "buddy", "buddy123", "bulldog", "buster", "butter", "buttercup1", "butterfly1", "butterfly7", "butthead", "buttons1", "calvin", "camaro", "cameron", "cameron1", "canada", "candy123", "captain", "carlos", "carolina1", "carter", "casper", "cassandra1", "catherine1", "celtic1888", "chargers1", "charles", "charles1", "charlie", "charlie1", "charlotte1", "charmed1", "cheese", "chelsea", "chelsea1", "chelsea123", "chester", "chester1", "chevy", "cheyenne1", "chicago", "chicago1", "chicken", "chicken1", "chocolate1", "chopper1", "chris", "chris123", "christian1", "christina1", "christine1", "christmas1", "classof08", "clayton1", "cocacola", "cock", "coffee", "college", "college1", "colombia1", "colorado1", "compaq", "computer", "computer1", "cookie", "cool", "cooper", "corvette", "courtney1", "cowboy", "cowboys", "cowboys1", "cream", "cricket1", "crystal", "crystal1", "cumming", "cumshot", "cunt", "cutiepie1", "daisy123", "dakota", "dallas", "dallas22", "dan1elle", "daniel", "daniela1", "danielle", "danielle1", "dave", "david", "david123", "death666", "debbie", "december1", "december21", "dennis", "derrick1", "destiny1", "deuseamor", "devil666", "diablo", "diamond", "diamond1", "diamonds1", "dick", "dirty", "doctor", "doggie", "dolphin", "dolphin1", "dolphins", "dolphins1", "dominic1", "donald", "douglas1", "dragon", "dreams", "driver", "eagle", "eagle1", "eagles", "edward", "einstein", "elizabeth1", "elizabeth2", "england1", "enjoy", "enter", "eric", "erotic", "extreme", "falcon", "falcons1", "falcons7", "familia", "fender", "ferrari", "fire", "firebird", "fish", "fishing", "florida", "florida1", "flower", "flyers", "football", "football1", "ford", "forever", "forever1", "forever21", "formula1", "frank", "frankie1", "fred", "freddie1", "freddy", "freedom", "freedom1", "friday13", "friends1", "friends2", "fuck", "fucked", "fucker", "fucking", "fuckme", "fuckoff1", "fuckyou", "fuckyou1", "fuckyou2", "fuckyou2", "gabriel1", "gandalf", "gangsta1", "garrett1", "gateway", "gateway1", "gators", "gemini", "genesis1", "george", "georgia1", "gerrard8", "giants", "giggles1", "ginger", "girl", "girls", "goddess1", "godislove1", "golden", "golf", "golfer", "gordon", "gordon24", "grandma1", "great", "green", "greenday1", "gregory", "guitar", "gunner", "hammer", "hannah", "happy", "hardcore", "harley", "harry123", "hawaii50", "heather", "heather1", "hello", "hello123", "helpme", "hentai", "hershey1", "hockey", "holiday1", "hollywood1", "honey123", "hooters", "horney", "horny", "hotdog", "house", "houston1", "hunter", "hunter01", "hunting", "iceman", "iloveme1", "iloveme2", "iloveyou", "iloveyou1", "iloveyou2", "iloveyou2", "internet", "internet1", "inuyasha1", "ireland1", "isabella1", "isabelle1", "iverson3", "iwantu", "iydgtvmujl6f", "jack", "jackie", "jackson", "jackson1", "jackson5", "jaguar", "jake", "jamaica1", "james", "james123", "january1", "january29", "japan", "jasmine", "jasmine1", "jason", "jasper", "jazmine1", "jeffrey1", "jehovah1", "jennifer", "jennifer1", "jennifer2", "jeremiah1", "jeremy", "jessica", "jessica1", "jessica7", "jesus", "jesus123", "jesus143", "jesus1st", "jesus4me", "jesus777", "jesuscristo", "jesusis#1", "jesusis1", "john", "john3:16", "johncena1", "johnny", "johnson", "jonathan1", "jordan", "jordan01", "jordan12", "jordan23", "joseph", "joshua", "joshua01", "juice", "junior", "justice1", "justin", "justin01", "justin11", "justin21", "justin23", "katelyn1", "katherine1", "kathryn1", "katrina1", "kelly", "kendall1", "kennedy1", "kenneth1", "kevin", "killer", "kimberly1", "king", "kitty", "knight", "kristen1", "kristin1", "l6fkiy9on", "ladies", "ladybug1", "lakers", "lakers24", "lampard8", "laura123", "lauren", "leather", "lebron23", "legend", "letmein", "letmein1", "liberty1", "lindsay1", "lindsey1", "little", "liverp00l", "liverpool1", "liverpool123", "london", "longhorns1", "love", "love4ever", "lover", "lovers", "loveyou2", "lucky", "lucky123", "m1chelle", "mackenzie1", "maddog", "madison", "madison01", "madison1", "madonna1", "maggie", "magic", "magnum", "makayla1", "marcelo", "marie123", "marine", "marines1", "marissa1", "mark", "marlboro", "marshall1", "martin", "marvin", "master", "matrix", "matt", "matthew", "matthew1", "matthew2", "matthew3", "maverick", "maxwell", "maxwell1", "melanie1", "melissa", "melissa1", "member", "mercedes", "mercedes1", "merlin", "metallica1", "michael", "michael01", "michael07", "michael1", "michael2", "michael7", "micheal1", "michele1", "michelle", "michelle1", "michelle2", "mickey", "midnight", "midnight1", "mike", "miller", "mine", "miranda1", "mistress", "molly123", "money", "monica", "monique1", "monkey", "monkey01", "monkey12", "monkey13", "monkeys1", "monster", "monster1", "montana1", "morgan", "mother", "mountain", "movie", "muffin", "murphy", "music", "music123", "mustang", "mustang1", "myspace1", "naked", "nascar", "natalie1", "natasha1", "nathan", "nathan06", "naughty", "ncc1701", "newyork", "newyork1", "nicholas", "nicholas1", "nichole1", "nicole", "nicole12", "ninja", "nipple", "nipples", "nirvana1", "november1", "november11", "november15", "november16", "nursing1", "october1", "october13", "october22", "oliver", "omarion1", "orange", "orlando1", "ou812", "p4ssword", "p@$$w0rd", "p@55w0rd", "p@ssw0rd", "pa$$w0rd", "pa55w0rd", "pa55word", "packers", "panther", "panther1", "panthers1", "panties", "paris", "parker", "pass", "pass1234", "passion1", "passw0rd", "passw0rd", "passw0rd1", "password", "password01", "password1", "password1", "password1!", "password11", "password12", "password12", "password123", "password123", "password13", "password2", "password21", "password3", "password4", "password5", "password7", "password9", "patches1", "patricia1", "patrick", "patrick1", "paul", "peaches", "peaches1", "peanut", "peanut01", "peanut11", "pebbles1", "penguin1", "penis", "pepper", "peter", "phantom", "phantom1", "phoenix", "phoenix1", "photoshop", "pickles1", "playboy1", "player", "please", "pokemon1", "poohbear1", "poohbear1", "pookie", "popcorn1", "porn", "porno", "porsche", "power", "pr1nc3ss", "pr1ncess", "precious1", "preston1", "prince", "princess", "princess01", "princess07", "princess08", "princess1", "princess12", "princess123", "princess13", "princess15", "princess18", "princess19", "princess2", "princess21", "princess23", "princess24", "princess4", "princess5", "princess7", "private", "prototype1", "pumpkin1", "purple", "pussies", "pussy", "qazwsx", "qwert", "qwerty", "qwerty123", "qwertyui", "rabbit", "rachel", "racing", "raiders", "raiders1", "rainbow", "rainbow1", "ranger", "rangers", "rangers1", "raymond1", "rebecca", "rebecca1", "rebelde1", "redskins", "redskins1", "redsox", "redwings", "ricardo1", "richard", "richard1", "robert", "robert01", "rock", "rocket", "rockstar1", "rocky123", "rockyou1", "rockyou1", "ronaldo7", "rosebud", "runner", "rush2112", "russell1", "russia", "rusty123", "sabrina1", "sail2boat3", "samantha", "samantha1", "sammy", "samson", "sandra", "santana1", "saturn", "savannah1", "scooby", "scooter", "scooter1", "scorpio", "scorpio1", "scorpion", "scotland1", "scott", "scrappy1", "sebastian1", "secret", "senior06", "senior07", "september1", "serenity1", "sexsex", "sexy", "shadow", "shannon", "shannon1", "shaved", "shit", "shopping1", "sierra", "silver", "skippy", "skittles1", "slayer", "slipknot1", "slut", "smith", "smokey", "smokey01", "snickers1", "snoopy", "snowball1", "soccer", "soccer11", "soccer12", "soccer13", "soccer14", "soccer17", "softball1", "sophie", "spanky", "sparky", "spartan117", "special1", "spencer1", "spider", "spiderman1", "spongebob1", "squirt", "srinivas", "star", "stars", "start123", "startrek", "starwars", "starwars1", "steelers", "steelers1", "stephanie1", "stephen1", "steve", "steven", "sticky", "stupid", "success", "suckit", "summer", "summer01", "summer05", "summer06", "summer07", "summer08", "summer99", "sunshine", "sunshine1", "super", "superman", "superman1", "superstar1", "surfer", "sweetie1", "sweetpea1", "swimming", "sydney", "taylor", "taylor13", "tbfkiy9on", "teddybear1", "teens", "tennis", "teresa", "test", "tester", "testing", "theman", "thesims2", "thirteen13", "thomas", "thumper1", "thunder", "thunder1", "thx1138", "tiffany", "tiffany1", "tiger", "tiger123", "tigers", "tigger", "tigger01", "tigger12", "tigger123", "time", "timothy1", "tinkerbell1", "titanic1", "tits", "tomcat", "topgun", "toyota", "travis", "trinity1", "trinity3", "tristan1", "trouble", "trouble1", "trustno1", "trustno1", "trustno1", "tucker", "turtle", "twilight1", "twitter", "unicorn1", "united", "vagina", "valerie1", "vampire1", "vanessa1", "vanilla1", "veronica1", "victor", "victoria", "victoria1", "video", "viking", "vincent1", "viper", "voodoo", "voyager", "walter", "warrior", "welcome", "welcome1", "welcome123", "welcome2", "whatever", "whatever1", "white", "whitney1", "william", "william1", "willie", "wilson", "winner", "winston", "winston1", "winter", "winter06", "wizard", "wolf", "women", "xavier", "xxxx", "xxxxx", "xxxxxx", "xxxxxxxx", "yamaha", "yankee", "yankees", "yankees1", "yankees2", "yellow", "young", "z,iyd86i", "zachary1", "zaq!1qaz", "zaq!2wsx", "zaq!xsw2", "zaq1!qaz", "zaq1@wsx", "zaq1zaq!", "zxcvbn", "zxcvbnm", "zzzzzz"];
|
280
|
+
PasswordStrength.commonWords = ["!qaz1qaz", "!qaz2wsx", "!qazxsw2", "!qazzaq1", "#edc4rfv", "000000", "010203", "1111", "11111", "111111", "11111111", "112233", "1212", "121212", "123123", "1234", "12345", "123456", "1234567", "12345678", "123456789", "1234567890", "123qweasd", "12qw!@qw", "1313", "131313", "1941.salembbb.41", "1qaz!qaz", "1qaz2wsx", "1qaz@wsx", "1qazxsw@", "1qazzaq!", "2000", "2112", "2222", "232323", "2wsx@wsx", "3333", "3edc#edc", "4128", "4321", "4444", "5150", "5555", "55555", "555555", "654321", "6666", "666666", "6969", "696969", "7777", "777777", "7777777", "8675309", "987654", "987654321", "@wsx2wsx", "aaaa", "aaaaaa", "aaliyah1", "abc123", "abc123abc", "abcabc123", "abcd1234", "abcdef", "abgrtyu", "abigail1", "access", "access14", "action", "addison1", "admin", "adobe123", "affair", "airforce1", "alabama1", "albert", "alex", "alexander1", "alexandra1", "alexis", "allison1", "amanda", "amateur", "america1", "anderson1", "andrea", "andrew", "angel", "angel101", "angel123", "angela", "angelina1", "angels", "animal", "annabelle1", "anthony", "anthony1", "anthony11", "antonio1", "apollo", "apple", "apples", "arianna1", "arsenal", "arsenal1", "arsenal12", "arsenal123", "arthur", "asdf", "asdfasdf", "asdfg", "asdfgh", "asdfghjkl", "ashley", "ashley12", "asshole", "asshole1", "atlanta1", "august", "august08", "august10", "august12", "august20", "august22", "austin", "austin02", "austin316", "australia1", "awesome1", "azerty", "baby", "babyboy1", "babygirl1", "babygurl1", "badboy", "bailey", "bailey12", "banana", "barcelona1", "barney", "baseball", "baseball1", "batista1", "batman", "beach", "bear", "beautiful1", "beaver", "beavis", "beckham7", "beer", "bella123", "benjamin1", "bentley1", "bethany1", "bigcock", "bigdaddy", "bigdaddy1", "bigdick", "bigdog", "bigtits", "bill", "billy", "birdie", "bitch", "bitches", "biteme", "black", "blazer", "blessed1", "blink-182", "blink182", "blonde", "blondes", "blondie1", "blowjob", "blowme", "blue", "bond007", "bonnie", "booboo", "boobs", "booger", "boomer", "booty", "boricua1", "boston", "bradley1", "brandon", "brandon1", "brandon2", "brandon7", "brandy", "braves", "braxton1", "brayden1", "brazil", "breanna1", "brian", "brianna1", "brittany1", "brittney1", "bronco", "broncos", "broncos1", "brooklyn1", "brownie1", "bubba", "bubbles1", "buddy", "buddy123", "bulldog", "buster", "butter", "buttercup1", "butterfly1", "butterfly7", "butthead", "buttons1", "calvin", "camaro", "cameron", "cameron1", "canada", "candy123", "captain", "carlos", "carolina1", "carter", "casper", "cassandra1", "catherine1", "celtic1888", "chargers1", "charles", "charles1", "charlie", "charlie1", "charlotte1", "charmed1", "cheese", "chelsea", "chelsea1", "chelsea123", "chester", "chester1", "chevy", "cheyenne1", "chicago", "chicago1", "chicken", "chicken1", "chocolate1", "chopper1", "chris", "chris123", "christian1", "christina1", "christine1", "christmas1", "classof08", "clayton1", "cocacola", "cock", "coffee", "college", "college1", "colombia1", "colorado1", "compaq", "computer", "computer1", "cookie", "cool", "cooper", "corvette", "courtney1", "cowboy", "cowboys", "cowboys1", "cream", "cricket1", "crystal", "crystal1", "cumming", "cumshot", "cunt", "cutiepie1", "daisy123", "dakota", "dallas", "dallas22", "dan1elle", "daniel", "daniela1", "danielle", "danielle1", "dave", "david", "david123", "death666", "debbie", "december1", "december21", "DEFAULT", "dennis", "derrick1", "destiny1", "deuseamor", "devil666", "diablo", "diamond", "diamond1", "diamonds1", "dick", "dirty", "doctor", "doggie", "dolphin", "dolphin1", "dolphins", "dolphins1", "dominic1", "donald", "douglas1", "dragon", "dreams", "driver", "eagle", "eagle1", "eagles", "edward", "einstein", "elizabeth1", "elizabeth2", "england1", "enjoy", "enter", "eric", "erotic", "extreme", "falcon", "falcons1", "falcons7", "familia", "fender", "ferrari", "fire", "firebird", "fish", "fishing", "florida", "florida1", "flower", "flyers", "football", "football1", "ford", "forever", "forever1", "forever21", "formula1", "frank", "frankie1", "fred", "freddie1", "freddy", "freedom", "freedom1", "friday13", "friends1", "friends2", "fuck", "fucked", "fucker", "fucking", "fuckme", "fuckoff", "fuckoff1", "fuckyou", "fuckyou1", "fuckyou2", "gabriel1", "gandalf", "gangsta1", "garrett1", "gateway", "gateway1", "gators", "gemini", "genesis1", "george", "georgia1", "gerrard8", "giants", "giggles1", "ginger", "girl", "girls", "goddess1", "godislove1", "golden", "golf", "golfer", "gordon", "gordon24", "grandma1", "great", "green", "greenday1", "gregory", "guitar", "gunner", "hammer", "hannah", "happy", "hardcore", "harley", "harry123", "hawaii50", "heather", "heather1", "hello", "hello123", "helpme", "hentai", "hershey1", "hockey", "holiday1", "hollywood1", "honey123", "hooters", "horney", "horny", "hosts", "hotdog", "house", "houston1", "hunter", "hunter01", "hunting", "iceman", "iloveme1", "iloveme2", "iloveyou", "iloveyou1", "iloveyou2", "internet", "internet1", "inuyasha1", "ireland1", "isabella1", "isabelle1", "iverson3", "iwantu", "iydgtvmujl6f", "jack", "jackie", "jackson", "jackson1", "jackson5", "jaguar", "jake", "jamaica1", "james", "james123", "january1", "january29", "japan", "jasmine", "jasmine1", "jason", "jasper", "jazmine1", "jeffrey1", "jehovah1", "jennifer", "jennifer1", "jennifer2", "jeremiah1", "jeremy", "jessica", "jessica1", "jessica7", "jesus", "jesus123", "jesus143", "jesus1st", "jesus4me", "jesus777", "jesuscristo", "jesusis#1", "jesusis1", "john", "john3:16", "johncena1", "johnny", "johnson", "jonathan1", "jordan", "jordan01", "jordan12", "jordan23", "joseph", "joshua", "joshua01", "juice", "junior", "justice1", "justin", "justin01", "justin11", "justin21", "justin23", "katelyn1", "katherine1", "kathryn1", "katrina1", "kazuga", "kelly", "kendall1", "kennedy1", "kenneth1", "kevin", "killer", "kimberly1", "king", "kitty", "knight", "kristen1", "kristin1", "l6fkiy9on", "ladies", "ladybug1", "lakers", "lakers24", "lampard8", "laura123", "lauren", "leather", "lebron23", "legend", "letmein", "letmein1", "liberty1", "lindsay1", "lindsey1", "little", "liverp00l", "liverpool", "liverpool1", "liverpool123", "london", "longhorns1", "looking", "love", "love4ever", "lover", "lovers", "loveyou2", "lucky", "lucky123", "m1chelle", "mackenzie1", "maddog", "madison", "madison01", "madison1", "madonna1", "maggie", "magic", "magnum", "makayla1", "marcelo", "marie123", "marine", "marines1", "marissa1", "mark", "marlboro", "marshall1", "martin", "marvin", "master", "matrix", "matt", "matthew", "matthew1", "matthew2", "matthew3", "maverick", "maxwell", "maxwell1", "melanie1", "melissa", "melissa1", "member", "mercedes", "mercedes1", "merlin", "metallica1", "michael", "michael01", "michael07", "michael1", "michael2", "michael7", "micheal1", "michele1", "michelle", "michelle1", "michelle2", "mickey", "midnight", "midnight1", "mike", "miller", "mine", "miranda1", "mistress", "molly123", "money", "monica", "monique1", "monkey", "monkey01", "monkey12", "monkey13", "monkeys1", "monster", "monster1", "montana1", "morgan", "mother", "mountain", "movie", "muffin", "murphy", "music", "music123", "mustang", "mustang1", "myspace1", "naked", "nascar", "natalie1", "natasha1", "nathan", "nathan06", "naughty", "ncc1701", "newyork", "newyork1", "nicholas", "nicholas1", "nichole1", "nicole", "nicole12", "ninja", "nipple", "nipples", "nirvana1", "november1", "november11", "november15", "november16", "nursing1", "october1", "october13", "october22", "oliver", "omarion1", "orange", "orlando1", "ou812", "p4ssword", "p@$$w0rd", "p@55w0rd", "p@ssw0rd", "pa$$w0rd", "pa55w0rd", "pa55word", "packers", "panther", "panther1", "panthers1", "panties", "paris", "parker", "pass", "pass1234", "passion1", "passw0rd", "passw0rd1", "password", "password01", "password1", "password1!", "password11", "password12", "password123", "password13", "password2", "password21", "password3", "password4", "password5", "password7", "password9", "patches1", "patricia1", "patrick", "patrick1", "paul", "peaches", "peaches1", "peanut", "peanut01", "peanut11", "pebbles1", "penguin1", "penis", "pepper", "peter", "phantom", "phantom1", "phoenix", "phoenix1", "photoshop", "pickles1", "playboy1", "player", "please", "pokemon1", "poohbear1", "pookie", "popcorn1", "porn", "porno", "porsche", "power", "pr1nc3ss", "pr1ncess", "precious1", "preston1", "prince", "princess", "princess01", "princess07", "princess08", "princess1", "princess12", "princess123", "princess13", "princess15", "princess18", "princess19", "princess2", "princess21", "princess23", "princess24", "princess4", "princess5", "princess7", "private", "prototype1", "pumpkin1", "purple", "pussies", "pussy", "qazwsx", "qwert", "qwerty", "qwerty123", "qwertyui", "qwertyuiop", "rabbit", "rachel", "racing", "raiders", "raiders1", "rainbow", "rainbow1", "ranger", "rangers", "rangers1", "raymond1", "rebecca", "rebecca1", "rebelde1", "redskins", "redskins1", "redsox", "redwings", "ricardo1", "richard", "richard1", "robert", "robert01", "rock", "rocket", "rockstar1", "rocky123", "rockyou1", "ronaldo7", "rosebud", "runner", "rush2112", "russell1", "russia", "rusty123", "sabrina1", "sail2boat3", "samantha", "samantha1", "sammy", "samson", "sandra", "santana1", "saturn", "savannah1", "scooby", "scooter", "scooter1", "scorpio", "scorpio1", "scorpion", "scotland1", "scott", "scrappy1", "sebastian1", "secret", "senior06", "senior07", "september1", "serenity1", "sexsex", "sexy", "shadow", "shannon", "shannon1", "shaved", "shit", "shopping1", "sierra", "silver", "skippy", "skittles1", "slayer", "slipknot1", "slut", "smith", "smokey", "smokey01", "snickers1", "snoopy", "snowball1", "soccer", "soccer11", "soccer12", "soccer13", "soccer14", "soccer17", "softball1", "sophie", "spanky", "sparky", "spartan117", "special1", "spencer1", "spider", "spiderman1", "spongebob1", "squirt", "srinivas", "star", "stars", "start123", "startrek", "starwars", "starwars1", "steelers", "steelers1", "stephanie1", "stephen1", "steve", "steven", "sticky", "stupid", "success", "suckit", "summer", "summer01", "summer05", "summer06", "summer07", "summer08", "summer99", "sunshine", "sunshine1", "super", "superman", "superman1", "superstar1", "surfer", "sweetie1", "sweetpea1", "swimming", "sydney", "taylor", "taylor13", "tbfkiy9on", "teddybear1", "teens", "tennis", "teresa", "test", "tester", "testing", "theman", "thesims2", "thirteen13", "thomas", "thumper1", "thunder", "thunder1", "thx1138", "tiffany", "tiffany1", "tiger", "tiger123", "tigers", "tigger", "tigger01", "tigger12", "tigger123", "time", "timothy1", "tinkerbell1", "titanic1", "tits", "tomcat", "topgun", "toyota", "travis", "trinity1", "trinity3", "tristan1", "trouble", "trouble1", "trustno1", "tucker", "turtle", "twilight1", "twitter", "unicorn1", "united", "vagina", "valerie1", "vampire1", "vanessa1", "vanilla1", "veronica1", "victor", "victoria", "victoria1", "video", "viking", "vincent1", "viper", "voodoo", "voyager", "walter", "warrior", "welcome", "welcome1", "welcome123", "welcome2", "whatever", "whatever1", "white", "whitney1", "william", "william1", "willie", "wilson", "winner", "winston", "winston1", "winter", "winter06", "wizard", "wolf", "women", "xavier", "xxxx", "xxxxx", "xxxxxx", "xxxxxxxx", "yamaha", "yankee", "yankees", "yankees1", "yankees2", "yellow", "young", "z,iyd86i", "zachary1", "zaq!1qaz", "zaq!2wsx", "zaq!xsw2", "zaq1!qaz", "zaq1@wsx", "zaq1zaq!", "zxcvbn", "zxcvbnm", "zzzzzz"];
|
268
281
|
|
269
|
-
|
282
|
+
if (typeof(module) === "object" && module.exports) {
|
283
|
+
module.exports = PasswordStrength;
|
284
|
+
} else if (typeof define === "function" && define.amd) {
|
285
|
+
define("password_strength", [], function() {
|
286
|
+
return PasswordStrength;
|
287
|
+
});
|
288
|
+
} else if (typeof(window) === "object") {
|
289
|
+
window.PasswordStrength = PasswordStrength;
|
290
|
+
}
|
270
291
|
})();
|
@@ -17,7 +17,7 @@ module ActiveModel # :nodoc:
|
|
17
17
|
|
18
18
|
def check_validity!
|
19
19
|
raise ArgumentError, "The :with option must be supplied" unless options.include?(:with)
|
20
|
-
raise ArgumentError, "The :exclude options must be an array of strings or regular expression" if options[:exclude] && !options[:exclude].kind_of?(Array) && !options[:exclude].kind_of?(Regexp)
|
20
|
+
raise ArgumentError, "The :exclude options must be an array of strings or a regular expression" if options[:exclude] && !options[:exclude].kind_of?(Array) && !options[:exclude].kind_of?(Regexp)
|
21
21
|
check_level_validity!(options[:level])
|
22
22
|
super
|
23
23
|
end
|
@@ -187,6 +187,8 @@ module PasswordStrength
|
|
187
187
|
invalid!
|
188
188
|
elsif common_word?
|
189
189
|
invalid!
|
190
|
+
elsif contain_invalid_repetion?
|
191
|
+
invalid!
|
190
192
|
else
|
191
193
|
@score += score_for(:password_size)
|
192
194
|
@score += score_for(:numbers)
|
@@ -223,6 +225,12 @@ module PasswordStrength
|
|
223
225
|
password.to_s =~ regex
|
224
226
|
end
|
225
227
|
|
228
|
+
def contain_invalid_repetion?
|
229
|
+
char = password.to_s.chars.first
|
230
|
+
regex = /^#{Regexp.escape(char)}+$/i
|
231
|
+
password.to_s =~ regex
|
232
|
+
end
|
233
|
+
|
226
234
|
def repetitions(text, size) # :nodoc:
|
227
235
|
count = 0
|
228
236
|
matches = []
|
data/package.json
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"name": "password_strength",
|
3
|
+
"version": "1.1.0",
|
4
|
+
"repository": "http://github.com/fnando/password_strength",
|
5
|
+
"license": "MIT",
|
6
|
+
"main": "app/assets/javascripts/password_strength.js",
|
7
|
+
"devDependencies": {
|
8
|
+
"jquery": "^2.1.4",
|
9
|
+
"qunitjs": "^1.20.0"
|
10
|
+
}
|
11
|
+
}
|
data/password_strength.gemspec
CHANGED
@@ -19,9 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
s.add_dependency "activemodel"
|
21
21
|
|
22
|
-
s.add_development_dependency "activerecord"
|
23
22
|
s.add_development_dependency "rake"
|
24
|
-
s.add_development_dependency "
|
25
|
-
s.add_development_dependency "
|
26
|
-
s.add_development_dependency "test-unit"
|
23
|
+
s.add_development_dependency "minitest"
|
24
|
+
s.add_development_dependency "minitest-utils"
|
27
25
|
end
|
data/support/common.txt
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
!qaz1qaz
|
2
2
|
!qaz2wsx
|
3
|
-
!qaz2wsx
|
4
3
|
!qazxsw2
|
5
4
|
!qazzaq1
|
6
5
|
#edc4rfv
|
@@ -27,6 +26,7 @@
|
|
27
26
|
131313
|
28
27
|
1941.salembbb.41
|
29
28
|
1qaz!qaz
|
29
|
+
1qaz2wsx
|
30
30
|
1qaz@wsx
|
31
31
|
1qazxsw@
|
32
32
|
1qazzaq!
|
@@ -42,6 +42,7 @@
|
|
42
42
|
4444
|
43
43
|
5150
|
44
44
|
5555
|
45
|
+
55555
|
45
46
|
555555
|
46
47
|
654321
|
47
48
|
6666
|
@@ -53,14 +54,13 @@
|
|
53
54
|
7777777
|
54
55
|
8675309
|
55
56
|
987654
|
57
|
+
987654321
|
56
58
|
@wsx2wsx
|
57
59
|
aaaa
|
58
60
|
aaaaaa
|
59
61
|
aaliyah1
|
60
62
|
abc123
|
61
63
|
abc123abc
|
62
|
-
abc123abc
|
63
|
-
abcabc123
|
64
64
|
abcabc123
|
65
65
|
abcd1234
|
66
66
|
abcdef
|
@@ -72,6 +72,7 @@ action
|
|
72
72
|
addison1
|
73
73
|
admin
|
74
74
|
adobe123
|
75
|
+
affair
|
75
76
|
airforce1
|
76
77
|
alabama1
|
77
78
|
albert
|
@@ -108,7 +109,10 @@ arsenal12
|
|
108
109
|
arsenal123
|
109
110
|
arthur
|
110
111
|
asdf
|
112
|
+
asdfasdf
|
113
|
+
asdfg
|
111
114
|
asdfgh
|
115
|
+
asdfghjkl
|
112
116
|
ashley
|
113
117
|
ashley12
|
114
118
|
asshole
|
@@ -129,7 +133,6 @@ azerty
|
|
129
133
|
baby
|
130
134
|
babyboy1
|
131
135
|
babygirl1
|
132
|
-
babygirl1
|
133
136
|
babygurl1
|
134
137
|
badboy
|
135
138
|
bailey
|
@@ -301,6 +304,7 @@ death666
|
|
301
304
|
debbie
|
302
305
|
december1
|
303
306
|
december21
|
307
|
+
DEFAULT
|
304
308
|
dennis
|
305
309
|
derrick1
|
306
310
|
destiny1
|
@@ -373,11 +377,11 @@ fucked
|
|
373
377
|
fucker
|
374
378
|
fucking
|
375
379
|
fuckme
|
380
|
+
fuckoff
|
376
381
|
fuckoff1
|
377
382
|
fuckyou
|
378
383
|
fuckyou1
|
379
384
|
fuckyou2
|
380
|
-
fuckyou2
|
381
385
|
gabriel1
|
382
386
|
gandalf
|
383
387
|
gangsta1
|
@@ -430,6 +434,7 @@ honey123
|
|
430
434
|
hooters
|
431
435
|
horney
|
432
436
|
horny
|
437
|
+
hosts
|
433
438
|
hotdog
|
434
439
|
house
|
435
440
|
houston1
|
@@ -442,7 +447,6 @@ iloveme2
|
|
442
447
|
iloveyou
|
443
448
|
iloveyou1
|
444
449
|
iloveyou2
|
445
|
-
iloveyou2
|
446
450
|
internet
|
447
451
|
internet1
|
448
452
|
inuyasha1
|
@@ -514,6 +518,7 @@ katelyn1
|
|
514
518
|
katherine1
|
515
519
|
kathryn1
|
516
520
|
katrina1
|
521
|
+
kazuga
|
517
522
|
kelly
|
518
523
|
kendall1
|
519
524
|
kennedy1
|
@@ -544,10 +549,12 @@ lindsay1
|
|
544
549
|
lindsey1
|
545
550
|
little
|
546
551
|
liverp00l
|
552
|
+
liverpool
|
547
553
|
liverpool1
|
548
554
|
liverpool123
|
549
555
|
london
|
550
556
|
longhorns1
|
557
|
+
looking
|
551
558
|
love
|
552
559
|
love4ever
|
553
560
|
lover
|
@@ -686,17 +693,13 @@ pass
|
|
686
693
|
pass1234
|
687
694
|
passion1
|
688
695
|
passw0rd
|
689
|
-
passw0rd
|
690
696
|
passw0rd1
|
691
697
|
password
|
692
698
|
password01
|
693
699
|
password1
|
694
|
-
password1
|
695
700
|
password1!
|
696
701
|
password11
|
697
702
|
password12
|
698
|
-
password12
|
699
|
-
password123
|
700
703
|
password123
|
701
704
|
password13
|
702
705
|
password2
|
@@ -732,7 +735,6 @@ player
|
|
732
735
|
please
|
733
736
|
pokemon1
|
734
737
|
poohbear1
|
735
|
-
poohbear1
|
736
738
|
pookie
|
737
739
|
popcorn1
|
738
740
|
porn
|
@@ -773,6 +775,7 @@ qwert
|
|
773
775
|
qwerty
|
774
776
|
qwerty123
|
775
777
|
qwertyui
|
778
|
+
qwertyuiop
|
776
779
|
rabbit
|
777
780
|
rachel
|
778
781
|
racing
|
@@ -801,7 +804,6 @@ rocket
|
|
801
804
|
rockstar1
|
802
805
|
rocky123
|
803
806
|
rockyou1
|
804
|
-
rockyou1
|
805
807
|
ronaldo7
|
806
808
|
rosebud
|
807
809
|
runner
|
@@ -949,8 +951,6 @@ tristan1
|
|
949
951
|
trouble
|
950
952
|
trouble1
|
951
953
|
trustno1
|
952
|
-
trustno1
|
953
|
-
trustno1
|
954
954
|
tucker
|
955
955
|
turtle
|
956
956
|
twilight1
|