gentle_brute 0.0.1
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.
- data/.gitignore +6 -0
- data/Gemfile +1 -0
- data/bin/GentleBrute +297 -0
- data/gentle_brute.gemspec +12 -0
- data/lib/gentle_brute/cpa_analyzer.rb +70 -0
- data/lib/gentle_brute/odometer.rb +167 -0
- data/lib/gentle_brute/pattern_finder.rb +64 -0
- data/lib/gentle_brute/resources/dictionary +24005 -0
- data/lib/gentle_brute/resources/neighbors.json +1 -0
- data/lib/gentle_brute/resources/suffixes +56 -0
- data/lib/gentle_brute/word_analyzer.rb +163 -0
- data/lib/gentle_brute.rb +30 -0
- data/passwords.txt +15 -0
- metadata +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"starters":{"a":{"a":[4,122],"b":[110,54],"c":[120,118],"d":[124,67],"e":[18,103],"f":[47,28],"g":[42,81],"h":[5,49],"i":[39,93],"j":[2,12],"k":[3,23],"l":[211,72],"m":[101,59],"n":[226,41],"o":[1,111],"p":[101,100],"q":[8,10],"r":[177,118],"s":[124,95],"t":[65,213],"u":[82,43],"v":[34,28],"w":[16,4],"x":[10,3],"y":[3,24],"z":[7,0]},"b":{"a":[320,151],"b":[0,28],"c":[0,76],"d":[0,51],"e":[312,86],"f":[0,19],"g":[0,44],"h":[2,13],"i":[133,86],"j":[0,2],"k":[0,8],"l":[137,145],"m":[1,27],"n":[0,120],"o":[220,139],"p":[1,14],"q":[0,2],"r":[250,219],"s":[1,91],"t":[1,107],"u":[198,80],"v":[0,9],"w":[0,23],"x":[0,8],"y":[20,32],"z":[0,13]},"c":{"a":[465,242],"b":[1,25],"c":[0,51],"d":[1,34],"e":[86,141],"f":[0,12],"g":[0,14],"h":[325,10],"i":[68,125],"j":[0,1],"k":[0,2],"l":[154,177],"m":[0,196],"n":[0,448],"o":[950,134],"p":[1,67],"q":[0,2],"r":[205,325],"s":[0,69],"t":[0,96],"u":[108,139],"v":[0,34],"w":[0,23],"x":[0,2],"y":[30,25],"z":[4,4]},"d":{"a":[121,105],"b":[0,40],"c":[1,113],"d":[0,24],"e":[481,53],"f":[0,58],"g":[0,42],"h":[2,7],"i":[295,31],"j":[1,2],"k":[0,5],"l":[0,92],"m":[0,79],"n":[2,100],"o":[179,44],"p":[0,58],"q":[0,0],"r":[100,69],"s":[0,164],"t":[0,47],"u":[90,42],"v":[0,56],"w":[7,38],"x":[0,6],"y":[20,14],"z":[0,5]},"e":{"a":[39,55],"b":[4,36],"c":[24,79],"d":[36,22],"e":[5,113],"f":[20,23],"g":[15,40],"h":[2,40],"i":[21,97],"j":[3,1],"k":[3,3],"l":[107,28],"m":[91,15],"n":[96,9],"o":[3,58],"p":[47,101],"q":[24,4],"r":[53,48],"s":[43,35],"t":[26,93],"u":[31,54],"v":[49,10],"w":[2,6],"x":[230,1],"y":[12,6],"z":[2,4]},"f":{"a":[142,115],"b":[1,17],"c":[1,33],"d":[1,16],"e":[104,97],"f":[0,8],"g":[0,15],"h":[0,2],"i":[153,64],"j":[1,2],"k":[0,1],"l":[157,79],"m":[2,19],"n":[0,70],"o":[174,85],"p":[1,2],"q":[0,0],"r":[155,173],"s":[0,43],"t":[1,26],"u":[73,63],"v":[0,5],"w":[0,3],"x":[0,10],"y":[0,11],"z":[0,5]},"g":{"a":[169,136],"b":[0,25],"c":[0,1],"d":[0,24],"e":[108,70],"f":[0,6],"g":[0,19],"h":[10,0],"i":[71,73],"j":[0,0],"k":[0,0],"l":[88,82],"m":[2,29],"n":[11,80],"o":[103,102],"p":[1,9],"q":[0,0],"r":[199,81],"s":[1,36],"t":[0,21],"u":[91,40],"v":[0,12],"w":[2,3],"x":[0,0],"y":[14,14],"z":[0,4]},"h":{"a":[274,68],"b":[0,36],"c":[0,28],"d":[0,57],"e":[242,12],"f":[0,8],"g":[0,35],"h":[0,2],"i":[107,25],"j":[0,1],"k":[0,2],"l":[0,114],"m":[0,88],"n":[0,124],"o":[239,17],"p":[0,44],"q":[0,0],"r":[1,174],"s":[0,53],"t":[0,42],"u":[93,28],"v":[0,10],"w":[0,22],"x":[0,10],"y":[72,15],"z":[0,7]},"i":{"a":[1,53],"b":[6,11],"c":[16,93],"d":[22,88],"e":[1,64],"f":[3,76],"g":[9,16],"h":[0,23],"i":[2,31],"j":[0,8],"k":[1,4],"l":[25,31],"m":[146,32],"n":[631,24],"o":[11,39],"p":[3,106],"q":[1,6],"r":[64,40],"s":[39,80],"t":[16,107],"u":[0,2],"v":[6,50],"w":[0,3],"x":[1,0],"y":[0,5],"z":[1,0]},"j":{"a":[70,10],"b":[0,7],"c":[0,31],"d":[0,17],"e":[50,5],"f":[0,5],"g":[0,14],"h":[0,13],"i":[20,5],"j":[0,4],"k":[0,5],"l":[0,17],"m":[0,13],"n":[0,41],"o":[77,2],"p":[0,3],"q":[0,0],"r":[1,26],"s":[0,25],"t":[0,12],"u":[77,10],"v":[0,8],"w":[0,10],"x":[0,2],"y":[0,6],"z":[0,2]},"k":{"a":[50,20],"b":[0,4],"c":[0,5],"d":[0,12],"e":[65,21],"f":[0,2],"g":[0,2],"h":[5,3],"i":[70,15],"j":[0,1],"k":[0,1],"l":[8,22],"m":[0,11],"n":[44,43],"o":[20,24],"p":[0,7],"q":[0,0],"r":[16,28],"s":[0,6],"t":[0,24],"u":[9,13],"v":[0,4],"w":[1,4],"x":[0,0],"y":[2,16],"z":[0,1]},"l":{"a":[211,46],"b":[0,47],"c":[0,66],"d":[0,17],"e":[166,17],"f":[0,21],"g":[0,59],"h":[0,3],"i":[186,20],"j":[0,0],"k":[0,11],"l":[1,17],"m":[0,59],"n":[0,115],"o":[159,33],"p":[0,22],"q":[0,8],"r":[0,38],"s":[1,39],"t":[1,70],"u":[93,37],"v":[0,34],"w":[0,23],"x":[0,13],"y":[20,12],"z":[0,9]},"m":{"a":[466,26],"b":[2,8],"c":[59,91],"d":[0,106],"e":[231,17],"f":[0,6],"g":[0,66],"h":[0,9],"i":[216,30],"j":[0,3],"k":[0,15],"l":[0,178],"m":[0,37],"n":[1,226],"o":[257,24],"p":[1,5],"q":[0,0],"r":[2,214],"s":[1,120],"t":[0,134],"u":[127,24],"v":[0,4],"w":[0,5],"x":[0,14],"y":[32,17],"z":[0,9]},"n":{"a":[86,18],"b":[2,23],"c":[3,46],"d":[2,10],"e":[144,12],"f":[0,2],"g":[1,35],"h":[1,4],"i":[82,13],"j":[1,1],"k":[0,3],"l":[0,13],"m":[1,28],"n":[0,25],"o":[122,17],"p":[0,15],"q":[0,1],"r":[1,51],"s":[1,22],"t":[1,60],"u":[49,34],"v":[0,22],"w":[0,31],"x":[0,3],"y":[8,1],"z":[0,6]},"o":{"a":[12,27],"b":[53,6],"c":[43,31],"d":[10,22],"e":[3,51],"f":[29,30],"g":[4,13],"h":[5,7],"i":[7,46],"j":[0,5],"k":[4,6],"l":[26,24],"m":[16,6],"n":[27,14],"o":[2,11],"p":[50,17],"q":[0,0],"r":[84,9],"s":[30,29],"t":[11,83],"u":[15,4],"v":[12,4],"w":[7,4],"x":[13,0],"y":[1,7],"z":[2,3]},"p":{"a":[352,142],"b":[1,9],"c":[0,54],"d":[0,32],"e":[295,193],"f":[2,6],"g":[0,31],"h":[89,1],"i":[151,91],"j":[0,1],"k":[0,8],"l":[137,133],"m":[1,27],"n":[2,131],"o":[252,265],"p":[1,50],"q":[0,2],"r":[415,326],"s":[33,107],"t":[4,119],"u":[111,53],"v":[1,7],"w":[0,15],"x":[0,3],"y":[23,56],"z":[0,4]},"q":{"a":[1,65],"b":[0,0],"c":[0,0],"d":[0,1],"e":[1,14],"f":[0,0],"g":[0,0],"h":[0,0],"i":[0,37],"j":[0,0],"k":[0,0],"l":[0,0],"m":[0,0],"n":[0,0],"o":[0,8],"p":[0,0],"q":[0,0],"r":[0,0],"s":[0,0],"t":[0,1],"u":[124,0],"v":[0,0],"w":[0,0],"x":[0,0],"y":[0,0],"z":[0,0]},"r":{"a":[169,35],"b":[0,51],"c":[1,99],"d":[0,80],"e":[460,27],"f":[0,44],"g":[0,51],"h":[31,3],"i":[92,35],"j":[0,5],"k":[0,2],"l":[0,33],"m":[0,61],"n":[0,65],"o":[153,29],"p":[1,66],"q":[0,5],"r":[0,5],"s":[1,111],"t":[0,76],"u":[86,27],"v":[0,58],"w":[1,12],"x":[0,1],"y":[4,14],"z":[0,3]},"s":{"a":[254,394],"b":[0,58],"c":[208,73],"d":[1,54],"e":[255,253],"f":[1,24],"g":[0,41],"h":[242,65],"i":[179,222],"j":[0,1],"k":[49,3],"l":[93,178],"m":[42,104],"n":[64,173],"o":[186,234],"p":[218,74],"q":[35,8],"r":[1,288],"s":[1,34],"t":[408,37],"u":[233,187],"v":[1,29],"w":[87,17],"x":[0,22],"y":[66,39],"z":[0,6]},"t":{"a":[166,175],"b":[0,29],"c":[0,29],"d":[0,19],"e":[211,126],"f":[0,10],"g":[0,16],"h":[198,4],"i":[89,138],"j":[0,0],"k":[0,10],"l":[0,71],"m":[0,59],"n":[1,95],"o":[150,72],"p":[0,52],"q":[0,0],"r":[301,156],"s":[3,32],"t":[2,43],"u":[84,58],"v":[2,2],"w":[33,17],"x":[0,38],"y":[29,15],"z":[0,0]},"u":{"a":[0,14],"b":[2,16],"c":[1,10],"d":[0,8],"e":[0,9],"f":[0,0],"g":[3,6],"h":[0,8],"i":[0,38],"j":[0,0],"k":[2,2],"l":[10,5],"m":[8,1],"n":[47,2],"o":[0,3],"p":[51,7],"q":[0,0],"r":[26,9],"s":[21,18],"t":[13,13],"u":[0,7],"v":[0,0],"w":[0,3],"x":[0,0],"y":[0,1],"z":[0,0]},"v":{"a":[83,6],"b":[0,4],"c":[0,41],"d":[0,6],"e":[123,13],"f":[0,0],"g":[0,18],"h":[0,3],"i":[132,11],"j":[0,0],"k":[0,1],"l":[2,65],"m":[0,3],"n":[0,53],"o":[53,6],"p":[0,0],"q":[0,0],"r":[1,86],"s":[0,37],"t":[0,22],"u":[6,8],"v":[0,9],"w":[0,2],"x":[0,4],"y":[1,1],"z":[0,1]},"w":{"a":[182,41],"b":[0,6],"c":[0,9],"d":[0,18],"e":[90,57],"f":[0,3],"g":[0,13],"h":[113,4],"i":[147,78],"j":[0,0],"k":[0,7],"l":[0,94],"m":[0,5],"n":[0,68],"o":[96,53],"p":[0,6],"q":[0,0],"r":[34,75],"s":[0,44],"t":[0,55],"u":[2,4],"v":[0,10],"w":[0,1],"x":[0,4],"y":[8,10],"z":[0,1]},"x":{"a":[1,0],"b":[0,0],"c":[0,0],"d":[0,0],"e":[5,0],"f":[0,0],"g":[0,0],"h":[0,0],"i":[1,0],"j":[0,0],"k":[0,0],"l":[0,3],"m":[0,0],"n":[0,2],"o":[0,0],"p":[0,0],"q":[0,0],"r":[0,3],"s":[0,0],"t":[0,0],"u":[0,0],"v":[0,1],"w":[0,0],"x":[0,0],"y":[3,0],"z":[0,0]},"y":{"a":[29,9],"b":[0,0],"c":[0,7],"d":[0,3],"e":[23,3],"f":[0,0],"g":[0,4],"h":[0,2],"i":[5,0],"j":[0,0],"k":[0,8],"l":[0,9],"m":[1,3],"n":[0,9],"o":[31,3],"p":[1,4],"q":[0,1],"r":[0,10],"s":[0,6],"t":[2,4],"u":[8,13],"v":[2,0],"w":[1,4],"x":[0,0],"y":[0,0],"z":[0,0]},"z":{"a":[8,4],"b":[0,1],"c":[0,2],"d":[0,2],"e":[16,2],"f":[0,0],"g":[0,5],"h":[0,0],"i":[13,2],"j":[0,0],"k":[0,0],"l":[1,2],"m":[0,4],"n":[0,7],"o":[12,6],"p":[0,2],"q":[0,0],"r":[0,8],"s":[0,2],"t":[0,1],"u":[2,2],"v":[0,0],"w":[0,0],"x":[0,0],"y":[0,0],"z":[0,0]}},"neighbors":{"a":{"a":[18,723],"b":[613,211],"c":[833,472],"d":[633,757],"e":[60,2160],"f":[145,120],"g":[483,322],"h":[100,445],"i":[451,1243],"j":[12,21],"k":[190,371],"l":[1703,848],"m":[615,232],"n":[2508,366],"o":[24,652],"p":[476,254],"q":[15,28],"r":[1907,445],"s":[791,541],"t":[2004,1278],"u":[344,255],"v":[224,85],"w":[153,43],"x":[66,11],"y":[260,376],"z":[71,29]},"b":{"a":[559,317],"b":[94,37],"c":[5,141],"d":[13,98],"e":[629,692],"f":[2,22],"g":[0,70],"h":[7,18],"i":[350,190],"j":[8,3],"k":[0,15],"l":[699,334],"m":[7,34],"n":[6,246],"o":[494,235],"p":[3,18],"q":[0,5],"r":[398,508],"s":[80,172],"t":[14,256],"u":[366,132],"v":[5,15],"w":[1,28],"x":[0,13],"y":[70,66],"z":[0,14]},"c":{"a":[935,592],"b":[3,122],"c":[132,92],"d":[10,118],"e":[779,547],"f":[2,42],"g":[10,23],"h":[1005,30],"i":[497,457],"j":[0,3],"k":[559,5],"l":[316,495],"m":[10,347],"n":[8,726],"o":[1357,471],"p":[3,212],"q":[13,3],"r":[443,595],"s":[15,293],"t":[487,349],"u":[385,322],"v":[0,49],"w":[0,55],"x":[0,3],"y":[118,82],"z":[4,5]},"d":{"a":[406,326],"b":[39,66],"c":[15,280],"d":[130,45],"e":[1273,359],"f":[20,73],"g":[89,79],"h":[33,33],"i":[778,192],"j":[16,2],"k":[3,8],"l":[112,274],"m":[49,175],"n":[24,367],"o":[393,253],"p":[19,89],"q":[3,4],"r":[286,291],"s":[109,285],"t":[19,179],"u":[218,111],"v":[25,70],"w":[57,80],"x":[0,16],"y":[147,68],"z":[1,9]},"e":{"a":[833,884],"b":[184,211],"c":[610,370],"d":[577,472],"e":[480,1189],"f":[209,125],"g":[253,213],"h":[79,253],"i":[217,1091],"j":[15,5],"k":[39,143],"l":[1062,494],"m":[534,295],"n":[2028,431],"o":[199,640],"p":[357,352],"q":[60,13],"r":[2871,619],"s":[1105,754],"t":[974,1724],"u":[148,423],"v":[248,124],"w":[195,60],"x":[357,3],"y":[254,231],"z":[35,36]},"f":{"a":[243,184],"b":[4,28],"c":[2,140],"d":[3,34],"e":[310,256],"f":[253,8],"g":[3,28],"h":[3,12],"i":[361,136],"j":[1,2],"k":[2,4],"l":[256,163],"m":[8,31],"n":[3,130],"o":[306,147],"p":[1,3],"q":[0,0],"r":[212,389],"s":[10,122],"t":[95,57],"u":[129,99],"v":[0,5],"w":[1,10],"x":[0,21],"y":[85,42],"z":[0,6]},"g":{"a":[426,428],"b":[13,57],"c":[0,27],"d":[5,41],"e":[723,325],"f":[5,9],"g":[144,32],"h":[262,18],"i":[305,231],"j":[1,0],"k":[4,2],"l":[209,201],"m":[45,62],"n":[129,378],"o":[272,241],"p":[8,24],"q":[0,0],"r":[418,231],"s":[42,115],"t":[30,310],"u":[232,70],"v":[0,25],"w":[10,18],"x":[0,0],"y":[139,44],"z":[1,7]},"h":{"a":[789,250],"b":[29,84],"c":[5,116],"d":[10,135],"e":[1026,176],"f":[7,33],"g":[4,72],"h":[4,15],"i":[542,145],"j":[0,2],"k":[3,16],"l":[50,371],"m":[58,254],"n":[38,426],"o":[769,235],"p":[7,122],"q":[1,1],"r":[175,663],"s":[18,246],"t":[162,187],"u":[205,134],"v":[1,41],"w":[38,65],"x":[0,11],"y":[249,43],"z":[0,18]},"i":{"a":[869,940],"b":[290,121],"c":[1434,354],"d":[577,302],"e":[480,1770],"f":[238,160],"g":[456,518],"h":[7,519],"i":[11,797],"j":[6,11],"k":[72,226],"l":[814,745],"m":[520,377],"n":[2446,1056],"o":[954,403],"p":[277,230],"q":[37,13],"r":[491,273],"s":[1258,359],"t":[1151,928],"u":[142,431],"v":[412,80],"w":[5,38],"x":[51,8],"y":[1,281],"z":[55,39]},"j":{"a":[94,11],"b":[0,8],"c":[0,61],"d":[0,22],"e":[76,5],"f":[0,5],"g":[0,16],"h":[0,17],"i":[23,12],"j":[0,4],"k":[0,6],"l":[0,19],"m":[0,17],"n":[0,53],"o":[102,2],"p":[0,3],"q":[0,0],"r":[1,40],"s":[0,30],"t":[0,17],"u":[107,16],"v":[0,9],"w":[0,10],"x":[0,3],"y":[0,7],"z":[0,2]},"k":{"a":[119,91],"b":[21,10],"c":[5,6],"d":[7,25],"e":[444,119],"f":[8,9],"g":[3,13],"h":[22,21],"i":[196,50],"j":[2,2],"k":[4,4],"l":[81,53],"m":[16,26],"n":[60,162],"o":[58,95],"p":[14,22],"q":[0,0],"r":[27,100],"s":[60,42],"t":[15,97],"u":[27,32],"v":[0,7],"w":[22,16],"x":[0,3],"y":[86,39],"z":[0,2]},"l":{"a":[1299,489],"b":[59,157],"c":[67,395],"d":[240,158],"e":[2065,498],"f":[69,73],"g":[51,322],"h":[20,95],"i":[1162,397],"j":[1,4],"k":[70,55],"l":[916,48],"m":[96,286],"n":[7,701],"o":[850,383],"p":[62,139],"q":[0,23],"r":[16,377],"s":[114,428],"t":[230,589],"u":[411,208],"v":[76,99],"w":[22,132],"x":[0,57],"y":[248,230],"z":[4,29]},"m":{"a":[1166,193],"b":[244,31],"c":[71,205],"d":[4,176],"e":[921,217],"f":[13,11],"g":[0,118],"h":[9,42],"i":[724,156],"j":[0,4],"k":[0,49],"l":[14,453],"m":[182,60],"n":[38,1000],"o":[600,181],"p":[462,15],"q":[2,1],"r":[7,490],"s":[47,286],"t":[6,559],"u":[238,138],"v":[3,11],"w":[7,13],"x":[0,20],"y":[99,42],"z":[0,15]},"n":{"a":[833,579],"b":[53,99],"c":[529,278],"d":[898,70],"e":[1168,1026],"f":[153,82],"g":[716,110],"h":[65,209],"i":[742,681],"j":[22,1],"k":[145,24],"l":[33,382],"m":[23,207],"n":[241,163],"o":[515,449],"p":[14,111],"q":[22,16],"r":[25,490],"s":[542,326],"t":[1514,552],"u":[210,379],"v":[99,56],"w":[25,82],"x":[10,30],"y":[156,168],"z":[30,18]},"o":{"a":[230,724],"b":[212,160],"c":[442,232],"d":[360,494],"e":[111,1228],"f":[139,173],"g":[357,232],"h":[50,263],"i":[205,862],"j":[10,15],"k":[129,299],"l":[889,386],"m":[749,250],"n":[2360,488],"o":[484,511],"p":[461,304],"q":[13,13],"r":[1591,399],"s":[583,849],"t":[546,863],"u":[940,173],"v":[173,78],"w":[370,40],"x":[75,8],"y":[89,422],"z":[26,13]},"p":{"a":[633,363],"b":[18,20],"c":[5,194],"d":[3,86],"e":[819,568],"f":[5,13],"g":[4,59],"h":[449,12],"i":[428,440],"j":[1,1],"k":[9,25],"l":[396,310],"m":[14,34],"n":[6,319],"o":[618,517],"p":[193,69],"q":[0,3],"r":[637,716],"s":[142,247],"t":[246,306],"u":[195,118],"v":[1,11],"w":[7,30],"x":[0,8],"y":[87,165],"z":[0,9]},"q":{"a":[1,113],"b":[0,0],"c":[0,0],"d":[0,1],"e":[1,97],"f":[0,0],"g":[0,0],"h":[0,0],"i":[0,129],"j":[0,0],"k":[0,0],"l":[0,0],"m":[0,0],"n":[0,0],"o":[0,13],"p":[0,0],"q":[0,0],"r":[0,0],"s":[0,0],"t":[0,1],"u":[355,0],"v":[0,0],"w":[0,0],"x":[0,0],"y":[0,3],"z":[0,0]},"r":{"a":[1762,866],"b":[169,233],"c":[255,576],"d":[393,363],"e":[1998,872],"f":[65,169],"g":[216,261],"h":[58,290],"i":[1527,711],"j":[6,15],"k":[160,35],"l":[142,393],"m":[313,394],"n":[278,826],"o":[1402,555],"p":[139,443],"q":[10,14],"r":[367,99],"s":[334,757],"t":[593,682],"u":[370,347],"v":[103,192],"w":[45,141],"x":[2,31],"y":[640,211],"z":[5,33]},"s":{"a":[505,856],"b":[43,180],"c":[485,191],"d":[16,133],"e":[1019,839],"f":[25,55],"g":[13,79],"h":[674,137],"i":[946,781],"j":[1,3],"k":[122,12],"l":[147,380],"m":[259,256],"n":[78,534],"o":[570,759],"p":[450,120],"q":[52,14],"r":[13,692],"s":[572,176],"t":[1710,190],"u":[374,340],"v":[12,115],"w":[121,53],"x":[0,27],"y":[180,142],"z":[0,8]},"t":{"a":[1102,708],"b":[27,146],"c":[129,457],"d":[3,117],"e":[2286,791],"f":[20,68],"g":[10,130],"h":[898,134],"i":[1726,512],"j":[1,0],"k":[8,32],"l":[140,389],"m":[50,275],"n":[23,809],"o":[1020,887],"p":[13,173],"q":[0,10],"r":[976,1308],"s":[84,229],"t":[432,343],"u":[452,183],"v":[5,159],"w":[66,77],"x":[0,54],"y":[372,149],"z":[41,5]},"u":{"a":[245,398],"b":[166,132],"c":[242,180],"d":[226,231],"e":[258,648],"f":[70,95],"g":[206,179],"h":[6,234],"i":[250,443],"j":[7,3],"k":[23,130],"l":[523,259],"m":[516,64],"n":[549,181],"o":[70,149],"p":[219,133],"q":[3,3],"r":[804,202],"s":[1051,256],"t":[506,566],"u":[3,121],"v":[13,30],"w":[2,16],"x":[30,2],"y":[12,67],"z":[24,25]},"v":{"a":[298,42],"b":[0,15],"c":[1,82],"d":[1,36],"e":[915,31],"f":[0,5],"g":[0,32],"h":[0,7],"i":[385,26],"j":[0,1],"k":[1,12],"l":[3,216],"m":[0,8],"n":[0,224],"o":[143,26],"p":[1,2],"q":[0,0],"r":[5,332],"s":[1,136],"t":[0,103],"u":[18,20],"v":[3,16],"w":[0,5],"x":[0,6],"y":[18,17],"z":[1,1]},"w":{"a":[420,82],"b":[28,12],"c":[6,24],"d":[21,36],"e":[232,135],"f":[12,10],"g":[1,30],"h":[138,12],"i":[284,133],"j":[0,0],"k":[11,11],"l":[42,165],"m":[14,28],"n":[102,128],"o":[211,118],"p":[10,15],"q":[0,0],"r":[58,255],"s":[32,96],"t":[11,118],"u":[8,13],"v":[0,15],"w":[2,6],"x":[1,5],"y":[19,91],"z":[1,3]},"x":{"a":[50,36],"b":[0,4],"c":[48,24],"d":[0,13],"e":[41,70],"f":[2,3],"g":[2,12],"h":[17,4],"i":[76,25],"j":[0,0],"k":[0,0],"l":[2,42],"m":[0,24],"n":[1,27],"o":[27,39],"p":[80,2],"q":[1,0],"r":[0,61],"s":[1,27],"t":[88,14],"u":[16,23],"v":[1,2],"w":[4,1],"x":[1,0],"y":[21,2],"z":[0,0]},"y":{"a":[97,102],"b":[31,8],"c":[86,26],"d":[61,29],"e":[101,165],"f":[8,5],"g":[22,10],"h":[18,73],"i":[16,106],"j":[1,1],"k":[5,10],"l":[101,60],"m":[91,11],"n":[79,82],"o":[80,140],"p":[102,35],"q":[1,1],"r":[79,105],"s":[113,30],"t":[58,74],"u":[15,33],"v":[4,7],"w":[27,5],"x":[3,2],"y":[0,7],"z":[2,1]},"z":{"a":[61,21],"b":[0,6],"c":[0,7],"d":[1,3],"e":[91,34],"f":[0,0],"g":[1,10],"h":[0,1],"i":[38,15],"j":[0,0],"k":[0,3],"l":[19,32],"m":[1,11],"n":[0,37],"o":[46,13],"p":[1,4],"q":[0,0],"r":[2,43],"s":[1,3],"t":[2,5],"u":[8,3],"v":[2,2],"w":[2,1],"x":[0,0],"y":[20,7],"z":[42,0]}},"enders":{"a":{"a":[9,104],"b":[15,6],"c":[239,16],"d":[97,336],"e":[6,1318],"f":[31,16],"g":[155,28],"h":[9,116],"i":[194,32],"j":[1,0],"k":[71,163],"l":[178,141],"m":[73,43],"n":[551,99],"o":[3,63],"p":[58,30],"q":[0,0],"r":[510,36],"s":[191,67],"t":[783,398],"u":[39,4],"v":[48,0],"w":[32,0],"x":[6,7],"y":[7,299],"z":[22,6]},"b":{"a":[46,28],"b":[17,5],"c":[0,13],"d":[1,21],"e":[82,496],"f":[0,0],"g":[0,16],"h":[1,2],"i":[66,1],"j":[0,0],"k":[0,0],"l":[484,31],"m":[1,4],"n":[0,35],"o":[49,8],"p":[0,2],"q":[0,0],"r":[15,45],"s":[1,19],"t":[1,33],"u":[33,1],"v":[0,0],"w":[0,4],"x":[0,5],"y":[4,31],"z":[0,1]},"c":{"a":[100,23],"b":[1,5],"c":[9,3],"d":[1,11],"e":[40,78],"f":[0,0],"g":[0,1],"h":[58,0],"i":[38,8],"j":[0,0],"k":[26,0],"l":[34,56],"m":[1,8],"n":[0,36],"o":[38,20],"p":[1,13],"q":[0,0],"r":[12,25],"s":[0,45],"t":[5,35],"u":[51,0],"v":[0,0],"w":[0,3],"x":[0,2],"y":[0,43],"z":[0,0]},"d":{"a":[82,33],"b":[1,2],"c":[0,24],"d":[17,20],"e":[191,119],"f":[0,0],"g":[47,5],"h":[1,7],"i":[78,1],"j":[0,0],"k":[0,1],"l":[58,40],"m":[1,32],"n":[3,87],"o":[66,11],"p":[1,7],"q":[0,0],"r":[27,99],"s":[2,30],"t":[5,11],"u":[23,2],"v":[0,0],"w":[0,11],"x":[0,7],"y":[2,56],"z":[1,1]},"e":{"a":[278,76],"b":[13,8],"c":[105,6],"d":[36,198],"e":[176,218],"f":[15,21],"g":[18,26],"h":[1,47],"i":[58,6],"j":[1,0],"k":[5,70],"l":[161,124],"m":[27,51],"n":[471,158],"o":[29,28],"p":[24,39],"q":[0,0],"r":[319,88],"s":[193,156],"t":[113,613],"u":[47,18],"v":[23,0],"w":[13,0],"x":[6,0],"y":[9,197],"z":[9,2]},"f":{"a":[20,6],"b":[1,4],"c":[1,14],"d":[1,3],"e":[38,22],"f":[12,0],"g":[0,4],"h":[0,2],"i":[41,2],"j":[0,0],"k":[1,1],"l":[28,7],"m":[1,1],"n":[1,17],"o":[9,3],"p":[1,1],"q":[0,0],"r":[5,32],"s":[0,1],"t":[11,10],"u":[8,1],"v":[0,0],"w":[0,3],"x":[0,12],"y":[0,33],"z":[0,0]},"g":{"a":[58,20],"b":[0,2],"c":[0,12],"d":[1,7],"e":[104,101],"f":[0,0],"g":[16,5],"h":[91,3],"i":[41,2],"j":[0,0],"k":[1,0],"l":[52,32],"m":[7,7],"n":[6,64],"o":[39,10],"p":[1,6],"q":[0,0],"r":[7,58],"s":[3,20],"t":[3,111],"u":[56,2],"v":[0,0],"w":[0,2],"x":[0,0],"y":[2,24],"z":[0,0]},"h":{"a":[87,18],"b":[1,4],"c":[0,35],"d":[0,16],"e":[150,18],"f":[0,1],"g":[1,8],"h":[0,3],"i":[80,4],"j":[0,0],"k":[0,0],"l":[2,28],"m":[2,42],"n":[5,50],"o":[68,7],"p":[0,22],"q":[0,0],"r":[2,85],"s":[0,21],"t":[7,27],"u":[33,4],"v":[0,2],"w":[0,21],"x":[0,1],"y":[3,19],"z":[0,5]},"i":{"a":[394,108],"b":[20,4],"c":[209,18],"d":[133,77],"e":[115,1106],"f":[114,23],"g":[39,256],"h":[0,215],"i":[2,25],"j":[0,0],"k":[48,95],"l":[188,234],"m":[62,220],"n":[674,761],"o":[569,43],"p":[23,12],"q":[0,0],"r":[128,64],"s":[453,75],"t":[310,244],"u":[134,8],"v":[242,1],"w":[0,4],"x":[2,3],"y":[0,259],"z":[10,14]},"j":{"a":[17,0],"b":[0,2],"c":[0,0],"d":[0,1],"e":[5,1],"f":[0,0],"g":[0,4],"h":[0,3],"i":[2,0],"j":[0,0],"k":[0,0],"l":[0,0],"m":[0,3],"n":[0,6],"o":[8,0],"p":[0,0],"q":[0,0],"r":[0,4],"s":[0,0],"t":[0,5],"u":[3,0],"v":[0,0],"w":[0,2],"x":[0,1],"y":[0,3],"z":[0,0]},"k":{"a":[10,3],"b":[0,0],"c":[0,0],"d":[0,7],"e":[125,50],"f":[0,0],"g":[1,1],"h":[1,1],"i":[41,0],"j":[0,0],"k":[1,1],"l":[33,4],"m":[0,2],"n":[0,62],"o":[9,4],"p":[0,9],"q":[0,0],"r":[1,25],"s":[1,7],"t":[0,34],"u":[9,0],"v":[0,1],"w":[0,3],"x":[0,1],"y":[2,19],"z":[0,0]},"l":{"a":[176,82],"b":[4,12],"c":[11,40],"d":[16,42],"e":[279,108],"f":[4,2],"g":[8,17],"h":[1,25],"i":[162,14],"j":[0,0],"k":[9,2],"l":[127,4],"m":[8,36],"n":[0,91],"o":[123,31],"p":[11,33],"q":[0,0],"r":[6,126],"s":[15,78],"t":[35,84],"u":[64,1],"v":[21,4],"w":[0,46],"x":[0,26],"y":[7,179],"z":[1,5]},"m":{"a":[248,26],"b":[13,1],"c":[2,53],"d":[0,15],"e":[189,8],"f":[0,0],"g":[0,6],"h":[0,5],"i":[101,3],"j":[0,0],"k":[0,3],"l":[0,38],"m":[20,9],"n":[3,346],"o":[37,12],"p":[23,3],"q":[0,0],"r":[2,35],"s":[2,30],"t":[1,45],"u":[35,2],"v":[0,0],"w":[0,4],"x":[0,7],"y":[0,25],"z":[0,0]},"n":{"a":[132,94],"b":[2,9],"c":[214,92],"d":[61,12],"e":[143,261],"f":[0,1],"g":[62,5],"h":[0,62],"i":[174,12],"j":[1,0],"k":[12,3],"l":[2,118],"m":[0,21],"n":[49,26],"o":[62,40],"p":[0,10],"q":[0,0],"r":[9,50],"s":[29,55],"t":[71,67],"u":[55,4],"v":[1,1],"w":[0,13],"x":[0,9],"y":[13,134],"z":[10,3]},"o":{"a":[82,92],"b":[18,20],"c":[76,7],"d":[47,231],"e":[25,463],"f":[35,49],"g":[95,33],"h":[10,45],"i":[90,22],"j":[1,0],"k":[32,142],"l":[162,74],"m":[100,83],"n":[239,144],"o":[237,26],"p":[53,26],"q":[0,0],"r":[400,45],"s":[128,415],"t":[73,259],"u":[465,1],"v":[33,0],"w":[73,0],"x":[7,4],"y":[7,313],"z":[6,0]},"p":{"a":[38,20],"b":[1,1],"c":[0,25],"d":[0,21],"e":[92,70],"f":[0,0],"g":[0,4],"h":[50,1],"i":[64,7],"j":[0,0],"k":[0,1],"l":[53,25],"m":[0,2],"n":[0,39],"o":[40,6],"p":[26,7],"q":[0,0],"r":[4,45],"s":[21,19],"t":[7,32],"u":[22,1],"v":[1,0],"w":[0,6],"x":[0,5],"y":[1,80],"z":[0,3]},"q":{"a":[0,3],"b":[0,0],"c":[0,0],"d":[0,1],"e":[1,31],"f":[0,0],"g":[0,0],"h":[0,0],"i":[0,1],"j":[0,0],"k":[0,0],"l":[0,0],"m":[0,0],"n":[0,0],"o":[0,1],"p":[0,0],"q":[0,0],"r":[0,0],"s":[0,0],"t":[0,0],"u":[39,0],"v":[0,0],"w":[0,0],"x":[0,0],"y":[0,3],"z":[0,0]},"r":{"a":[205,71],"b":[4,18],"c":[43,82],"d":[20,56],"e":[161,180],"f":[0,2],"g":[43,18],"h":[1,59],"i":[230,7],"j":[0,1],"k":[12,6],"l":[16,124],"m":[12,66],"n":[25,97],"o":[158,39],"p":[11,39],"q":[0,1],"r":[68,15],"s":[63,60],"t":[72,60],"u":[60,1],"v":[18,1],"w":[0,43],"x":[0,12],"y":[6,165],"z":[2,7]},"s":{"a":[67,52],"b":[2,3],"c":[20,20],"d":[2,9],"e":[139,60],"f":[1,3],"g":[2,1],"h":[27,4],"i":[145,10],"j":[0,1],"k":[18,1],"l":[13,50],"m":[4,17],"n":[2,205],"o":[197,20],"p":[4,8],"q":[0,0],"r":[2,51],"s":[37,98],"t":[49,30],"u":[31,6],"v":[1,0],"w":[0,7],"x":[0,6],"y":[0,100],"z":[0,1]},"t":{"a":[121,40],"b":[0,5],"c":[54,237],"d":[0,38],"e":[401,159],"f":[0,2],"g":[0,5],"h":[66,55],"i":[313,4],"j":[0,0],"k":[3,4],"l":[61,77],"m":[0,41],"n":[1,226],"o":[302,25],"p":[0,25],"q":[0,0],"r":[70,384],"s":[4,70],"t":[88,15],"u":[56,2],"v":[2,2],"w":[3,7],"x":[0,9],"y":[5,118],"z":[0,0]},"u":{"a":[55,38],"b":[13,11],"c":[62,2],"d":[72,78],"e":[39,398],"f":[20,23],"g":[37,36],"h":[1,86],"i":[42,14],"j":[2,0],"k":[9,51],"l":[97,76],"m":[40,5],"n":[139,38],"o":[5,17],"p":[13,23],"q":[0,0],"r":[233,12],"s":[150,17],"t":[83,125],"u":[3,6],"v":[1,0],"w":[0,1],"x":[2,0],"y":[1,59],"z":[5,8]},"v":{"a":[35,15],"b":[0,0],"c":[0,5],"d":[1,7],"e":[145,7],"f":[0,0],"g":[0,0],"h":[0,3],"i":[57,1],"j":[0,0],"k":[0,3],"l":[0,40],"m":[0,0],"n":[0,50],"o":[11,0],"p":[0,0],"q":[0,0],"r":[2,66],"s":[0,28],"t":[0,13],"u":[2,0],"v":[1,1],"w":[0,2],"x":[0,3],"y":[0,9],"z":[0,1]},"w":{"a":[87,2],"b":[1,4],"c":[1,1],"d":[3,3],"e":[42,8],"f":[0,0],"g":[0,7],"h":[2,2],"i":[23,1],"j":[0,0],"k":[1,1],"l":[2,11],"m":[0,4],"n":[5,22],"o":[6,2],"p":[0,3],"q":[0,0],"r":[6,25],"s":[3,3],"t":[1,6],"u":[2,0],"v":[0,0],"w":[0,1],"x":[0,1],"y":[2,81],"z":[1,0]},"x":{"a":[17,1],"b":[0,0],"c":[0,3],"d":[0,0],"e":[10,2],"f":[0,0],"g":[0,0],"h":[0,1],"i":[10,1],"j":[0,0],"k":[0,0],"l":[1,3],"m":[0,3],"n":[0,13],"o":[8,0],"p":[0,1],"q":[0,0],"r":[0,1],"s":[0,19],"t":[2,1],"u":[1,0],"v":[0,0],"w":[0,0],"x":[0,0],"y":[1,1],"z":[0,0]},"y":{"a":[19,7],"b":[1,0],"c":[7,0],"d":[6,13],"e":[38,52],"f":[0,0],"g":[0,0],"h":[1,8],"i":[2,2],"j":[0,0],"k":[1,1],"l":[12,9],"m":[5,1],"n":[11,21],"o":[15,3],"p":[19,3],"q":[0,0],"r":[9,24],"s":[9,3],"t":[13,11],"u":[2,3],"v":[0,1],"w":[0,2],"x":[0,2],"y":[0,4],"z":[0,0]},"z":{"a":[13,6],"b":[0,0],"c":[0,1],"d":[1,0],"e":[18,20],"f":[0,0],"g":[0,5],"h":[0,1],"i":[9,1],"j":[0,0],"k":[0,1],"l":[17,5],"m":[0,1],"n":[0,15],"o":[14,5],"p":[0,2],"q":[0,0],"r":[1,11],"s":[0,0],"t":[0,1],"u":[0,0],"v":[0,1],"w":[0,0],"x":[0,0],"y":[0,7],"z":[10,0]}}}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
agogy
|
|
2
|
+
archy
|
|
3
|
+
cele
|
|
4
|
+
coele
|
|
5
|
+
coel
|
|
6
|
+
centesis
|
|
7
|
+
chondrion
|
|
8
|
+
cide
|
|
9
|
+
cracy
|
|
10
|
+
cycle
|
|
11
|
+
ectasia
|
|
12
|
+
ectasis
|
|
13
|
+
ectomy
|
|
14
|
+
emesis
|
|
15
|
+
emia
|
|
16
|
+
enchyma
|
|
17
|
+
ess
|
|
18
|
+
esthesis
|
|
19
|
+
esthesia
|
|
20
|
+
fugal
|
|
21
|
+
ful
|
|
22
|
+
hedron
|
|
23
|
+
holic
|
|
24
|
+
ic
|
|
25
|
+
id
|
|
26
|
+
ism
|
|
27
|
+
ist
|
|
28
|
+
itis
|
|
29
|
+
itude
|
|
30
|
+
ium
|
|
31
|
+
kinesis
|
|
32
|
+
less
|
|
33
|
+
ly
|
|
34
|
+
like
|
|
35
|
+
mania
|
|
36
|
+
ography
|
|
37
|
+
ogram
|
|
38
|
+
oid
|
|
39
|
+
ology
|
|
40
|
+
omics
|
|
41
|
+
onomy
|
|
42
|
+
onym
|
|
43
|
+
osis
|
|
44
|
+
phagy
|
|
45
|
+
phagia
|
|
46
|
+
philia
|
|
47
|
+
phobia
|
|
48
|
+
phone
|
|
49
|
+
science
|
|
50
|
+
scope
|
|
51
|
+
ship
|
|
52
|
+
stan
|
|
53
|
+
tropism
|
|
54
|
+
us
|
|
55
|
+
ward
|
|
56
|
+
wise
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
module GentleBrute
|
|
2
|
+
class WordAnalyzer
|
|
3
|
+
def initialize(cpa_threshold)
|
|
4
|
+
@suffixes = File.read(File.expand_path('../resources/suffixes', __FILE__)).split "\n"
|
|
5
|
+
@vowels = ['a', 'e', 'i', 'o', 'u']
|
|
6
|
+
@chars = ('a'..'z').to_a + ["'"]
|
|
7
|
+
@punctuation = ["!", "?", ".", ","]
|
|
8
|
+
@cpa_threshold = cpa_threshold
|
|
9
|
+
@cpa_analyzer = CPAAnalyzer.new
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Test whether or not a given word follows the rules of English-like words
|
|
13
|
+
# @param [String] word the word to test for validity
|
|
14
|
+
# @return [Boolean] whether or not the word passed all the validation tests
|
|
15
|
+
def is_valid_word? word
|
|
16
|
+
return false if word.empty? # Empty words are not valid words
|
|
17
|
+
word.downcase! # ignore mixed casing
|
|
18
|
+
return is_valid_phrase? word if word.include? " " # If it's a phrase, test it as a phrase
|
|
19
|
+
length = word.length
|
|
20
|
+
|
|
21
|
+
# The only valid single letter words are 'a' and 'i'
|
|
22
|
+
return false if length == 1 and word != "i" and word != "a"
|
|
23
|
+
|
|
24
|
+
# The word must contain at least one vowel
|
|
25
|
+
return false if not has_vowel? word
|
|
26
|
+
|
|
27
|
+
# Validate Character Position Analysis Scores
|
|
28
|
+
return false if not passes_neighbor_tests? word
|
|
29
|
+
|
|
30
|
+
# The word must conform to proper apostrophe usage rules
|
|
31
|
+
return false if not uses_valid_apostrophes? word
|
|
32
|
+
|
|
33
|
+
# Does the word follow proper suffix patterns?
|
|
34
|
+
return false if not follows_proper_suffix_patterns? word
|
|
35
|
+
|
|
36
|
+
# Does the word contain triple char patterns?
|
|
37
|
+
return false if word.length > 5 and not passes_direct_patterns_test? word
|
|
38
|
+
|
|
39
|
+
# The word is (probably) valid!
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Test whether or not a given phrase follows the rules of English-like phrases
|
|
44
|
+
# @param [String] phrase the phrase to test for validity
|
|
45
|
+
# @return [Boolean] whether or not the phrase passed all the validation tests
|
|
46
|
+
def is_valid_phrase? phrase
|
|
47
|
+
# Does the phrase start or end with a space?
|
|
48
|
+
return false if phrase =~ /^ /
|
|
49
|
+
return false if phrase =~ / $/
|
|
50
|
+
return false if phrase.include? "-" and phrase.include? "_"
|
|
51
|
+
return false if phrase.include? " "
|
|
52
|
+
|
|
53
|
+
phrases = phrase.split " "
|
|
54
|
+
phrases.each do | phrase_ |
|
|
55
|
+
return false if phrase_.split(" ").length == 1 # phrases can't be just one word
|
|
56
|
+
return false if not passes_phrase_pattern_test? phrase_
|
|
57
|
+
phrase_.split(" ").each do | word |
|
|
58
|
+
return false if not is_valid_word? word
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
true
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
### Begin Phrase Testing Functions ###
|
|
66
|
+
|
|
67
|
+
def passes_phrase_pattern_test? phrase
|
|
68
|
+
pattern_data = PatternFinder.patterns_in_strintg phrase
|
|
69
|
+
return true if pattern_data == nil
|
|
70
|
+
return false if pattern_data[3] > 3
|
|
71
|
+
true
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
### Begin Word Testing Functions ###
|
|
75
|
+
|
|
76
|
+
# Test whether or not a given word has at least one vowel
|
|
77
|
+
# @param [String] word the word to test
|
|
78
|
+
# @return [Boolean] whether or not the word passed the test
|
|
79
|
+
def has_vowel? word
|
|
80
|
+
@vowels.any? { |vowel| word.include? vowel }
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Test whether or not a given word follows proper apostrophe usage rules
|
|
84
|
+
# @param [String] word the word to test
|
|
85
|
+
# @return [Boolean] whether or not the word passed the test
|
|
86
|
+
def uses_valid_apostrophes? word
|
|
87
|
+
if word.include? "'"
|
|
88
|
+
length = word.length
|
|
89
|
+
index = word.index "'"
|
|
90
|
+
return false if length-1 != word.tr("'", "").length
|
|
91
|
+
return false if index != length-1 and index != length-2
|
|
92
|
+
return false if word[-1] != 's' and word[-2] != 's' and word[-1] != 't' and word[-1] != 'm' and word[-1] != 'd'
|
|
93
|
+
end
|
|
94
|
+
true
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Test whether or not a given word follows proper suffix usage patterns
|
|
98
|
+
# @param [String] word the word to test
|
|
99
|
+
# @return [Boolean] whether or not the word passed the test
|
|
100
|
+
def follows_proper_suffix_patterns? word
|
|
101
|
+
@suffixes.each do | suffix |
|
|
102
|
+
next if not word =~ /#{suffix}$/
|
|
103
|
+
return true if word.length == suffix.length
|
|
104
|
+
index = (suffix.length * -1) - 1
|
|
105
|
+
return false if word[index] == suffix[0]
|
|
106
|
+
end
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Verify a given word does not have any illegal character patterns
|
|
111
|
+
# @param [String] word the word to test
|
|
112
|
+
# @return [Boolean] whether or not the word passed the test
|
|
113
|
+
def passes_direct_patterns_test? word
|
|
114
|
+
pattern_data = PatternFinder.patterns_in_strintg word
|
|
115
|
+
return true if not pattern_data
|
|
116
|
+
return false if pattern_data[3] > 2
|
|
117
|
+
true
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Verify a given word has all the required CPA neighbor scores
|
|
121
|
+
# @param [String] word the word to test
|
|
122
|
+
# @return [Boolean] whether or not the word passed the test
|
|
123
|
+
def passes_neighbor_tests? word
|
|
124
|
+
length = word.length
|
|
125
|
+
for i in 0...length
|
|
126
|
+
char = word[i]
|
|
127
|
+
char_r = word[i+1]
|
|
128
|
+
char_rr = word[i+2]
|
|
129
|
+
return false if char == char_r and char == char_rr
|
|
130
|
+
return false if char == char_r and length == 2
|
|
131
|
+
return false if not @chars.include? char
|
|
132
|
+
|
|
133
|
+
if char_r
|
|
134
|
+
begin
|
|
135
|
+
if i == 0
|
|
136
|
+
return false if @cpa_analyzer.get_starter_neighbor_score(char, char_r)[0] == 0
|
|
137
|
+
elsif i == length-3
|
|
138
|
+
return false if @cpa_analyzer.get_ender_neighbor_score(char, char_r)[0] == 0
|
|
139
|
+
end
|
|
140
|
+
score = @cpa_analyzer.get_neighbor_score(char, char_r)
|
|
141
|
+
return false if score[0] < @cpa_threshold
|
|
142
|
+
rescue
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if char_rr
|
|
147
|
+
begin
|
|
148
|
+
if i == 0
|
|
149
|
+
return false if @cpa_analyzer.get_starter_neighbor_score(char, char_rr)[1] == 0
|
|
150
|
+
elsif i == length-3
|
|
151
|
+
return false if @cpa_analyzer.get_ender_neighbor_score(char, char_rr)[1] == 0
|
|
152
|
+
end
|
|
153
|
+
score = @cpa_analyzer.get_neighbor_score(char, char_rr)
|
|
154
|
+
return false if score[1] < @cpa_threshold
|
|
155
|
+
rescue
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
true
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
data/lib/gentle_brute.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Encoding.default_external = Encoding.find 'UTF-8'
|
|
2
|
+
Encoding.default_internal = Encoding.find 'UTF-8'
|
|
3
|
+
|
|
4
|
+
require 'json'
|
|
5
|
+
|
|
6
|
+
$:.unshift File.expand_path("..", __FILE__)
|
|
7
|
+
require 'gentle_brute/pattern_finder'
|
|
8
|
+
require 'gentle_brute/word_analyzer'
|
|
9
|
+
require 'gentle_brute/odometer'
|
|
10
|
+
require 'gentle_brute/cpa_analyzer'
|
|
11
|
+
|
|
12
|
+
module GentleBrute
|
|
13
|
+
class BruteForcer
|
|
14
|
+
# @param [Number] start_length the starthing length of the string to start generating potential words
|
|
15
|
+
# @param [Number] cpa_threshold the minimum character position analysis score neighboring characters must have
|
|
16
|
+
def initialize(start_length=1, cpa_threshold=24)
|
|
17
|
+
@odometer = Odometer.new start_length
|
|
18
|
+
@word_analyzer = WordAnalyzer.new cpa_threshold
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [String] the next English-like brute force phrase
|
|
22
|
+
def next_valid_phrase
|
|
23
|
+
while true
|
|
24
|
+
@odometer.increment
|
|
25
|
+
phrase = @odometer.string_for_odometer
|
|
26
|
+
return phrase if @word_analyzer.is_valid_word? phrase
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/passwords.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
865c0c0b4ab0e063e5caa3387c1a8741
|
|
2
|
+
4e8f41fc6bb2a085340ba742f4bb655f
|
|
3
|
+
4a2028eceac5e1f4d252ea13c71ecec6
|
|
4
|
+
1bd6a4bd202c9f60f1c05f7d5a6018ba
|
|
5
|
+
d4579b2688d675235f402f6b4b43bcbf
|
|
6
|
+
a77b3598941cb803eac0fcdafe44fac9
|
|
7
|
+
1bd6a4bd202c9f60f1c05f7d5a6018ba
|
|
8
|
+
344dfdad53124d40af91ca4ffa8fd10f
|
|
9
|
+
865c0c0b4ab0e063e5caa3387c1a8741
|
|
10
|
+
a77b3598941cb803eac0fcdafe44fac9
|
|
11
|
+
f97c5d29941bfb1b2fdab0874906ab82
|
|
12
|
+
8bf8854bebe108183caeb845c7676ae4
|
|
13
|
+
43a0a1e8212cd9140a5c1fa1ef5a5bac
|
|
14
|
+
19ffc3d99f4a554333f5d0f24e6f1d11
|
|
15
|
+
057bb9f6078a1cb2f4f6c40e63a10564
|
metadata
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gentle_brute
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Brandon Smith
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2011-12-02 00:00:00.000000000 Z
|
|
13
|
+
dependencies: []
|
|
14
|
+
description: A heuristic brute forcing algorithm for Ruby that generates brute force
|
|
15
|
+
passphrases that adhere to the rules of English-like words and phrases.
|
|
16
|
+
email: brandon.smith@studiobebop.net
|
|
17
|
+
executables:
|
|
18
|
+
- GentleBrute
|
|
19
|
+
extensions: []
|
|
20
|
+
extra_rdoc_files: []
|
|
21
|
+
files:
|
|
22
|
+
- .gitignore
|
|
23
|
+
- Gemfile
|
|
24
|
+
- bin/GentleBrute
|
|
25
|
+
- gentle_brute.gemspec
|
|
26
|
+
- lib/gentle_brute.rb
|
|
27
|
+
- lib/gentle_brute/cpa_analyzer.rb
|
|
28
|
+
- lib/gentle_brute/odometer.rb
|
|
29
|
+
- lib/gentle_brute/pattern_finder.rb
|
|
30
|
+
- lib/gentle_brute/resources/dictionary
|
|
31
|
+
- lib/gentle_brute/resources/neighbors.json
|
|
32
|
+
- lib/gentle_brute/resources/suffixes
|
|
33
|
+
- lib/gentle_brute/word_analyzer.rb
|
|
34
|
+
- passwords.txt
|
|
35
|
+
homepage: http://github.com/jamespenguin/gentle-brute
|
|
36
|
+
licenses: []
|
|
37
|
+
post_install_message:
|
|
38
|
+
rdoc_options: []
|
|
39
|
+
require_paths:
|
|
40
|
+
- lib
|
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
42
|
+
none: false
|
|
43
|
+
requirements:
|
|
44
|
+
- - ! '>='
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
|
+
none: false
|
|
49
|
+
requirements:
|
|
50
|
+
- - ! '>='
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
requirements:
|
|
54
|
+
- slop >= 2.3.1
|
|
55
|
+
rubyforge_project:
|
|
56
|
+
rubygems_version: 1.8.11
|
|
57
|
+
signing_key:
|
|
58
|
+
specification_version: 3
|
|
59
|
+
summary: The better brute force algorithm
|
|
60
|
+
test_files: []
|