-
Notifications
You must be signed in to change notification settings - Fork 13
/
sha_test.go
222 lines (218 loc) · 10.7 KB
/
sha_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
package htpasswd
import (
"testing"
)
type shaDatum struct {
password string
hashed string
}
var shaTestData = []shaDatum{
{"mickey5", "{SHA}D9rQ8iK6feNAniulHNKdr5V38ok="},
{"alexandrew", "{SHA}KS7VQqgAnMUfXgWmFCCa6DVhY+M="},
{"hawaiicats78", "{SHA}mzD9ouM0P06arY0Obdb2KojkFeY="},
{"DIENOW", "{SHA}2HrOk971ockoAr1Ct1o7GpvFLdU="},
{"e8f685", "{SHA}IyrjpSzIjrlLT7KjVh1q1LBDCFA="},
{"Rickygirl03", "{SHA}gh5ZdWJ6UypV+CRv8Kd0herEe8U="},
{"123vb123", "{SHA}19j8b+o4MIImvb7zkv4gncUWs1s="},
{"sheng060576", "{SHA}u5hjc4kFFwv2QrMa49uCmn7RmPQ="},
{"hansisme", "{SHA}Au92ail1kvpgW+HC4PiuJu1Yays="},
{"h4ck3rs311t3", "{SHA}KvvqIY6j/LU3D/orcNYioTE4yOQ="},
{"K90JyTGA", "{SHA}QftskBtqwp5hsovHb+dGB7azRsI="},
{"aspire5101", "{SHA}vjUxr9fJRAYTdO0lZb83C2z0FKo="},
{"553568", "{SHA}FTguhILOzfejAav4aWK2X4D51qE="},
{"SRI", "{SHA}7CPWhF7FKaS6fBC+zAuncRjVDOo="},
{"maxmus", "{SHA}tHLz2JrCsGMOAPUh38Td1yP65rI="},
{"a5xp9707", "{SHA}qTzg8xc+MFLHwsR9DFVuUTPiFA8="},
{"tomasrim", "{SHA}BxtDkfZMLEfKDlqluTcU/UOFknw="},
{"2a0mag", "{SHA}cnCoTKX3EK7nIA+zmxcu3ovItrM="},
{"wmsfht", "{SHA}pBahyhKlvfj+JoJNul/LNITFz+A="},
{"webmaster2364288", "{SHA}NQb47c348gpwiOL+NqztAYm6LVQ="},
{"121516m", "{SHA}Oy/RamubYWzVZ1IxxiezV5G8ODc="},
{"T69228803", "{SHA}gN1LmPBMrRxZkzhipSu/vEKgqnY="},
{"qq820221", "{SHA}zMx1exH6oGOtF78Y8ZY7KPp2E5k="},
{"chenfy", "{SHA}5wQp5hYE/N3i/i6Yjz97fBQwh/s="},
{"www.debure.net", "{SHA}quy6WOPSGssG33/XYI1GjM1EcSw="},
{"1333e763", "{SHA}rmbzU+tedWkSg4z19JgtmpXoO60="},
{"burberries", "{SHA}lCe4FgTHpkpOhbCp0K5JqA5Ze9Q="},
{"chanmee14", "{SHA}AJnAjBWd4U8wze/raohAgH69VJk="},
{"65432106543210", "{SHA}CesAlg5KhkapACkKNGlfyDZu1RA="},
{"powernet", "{SHA}K3p3TiyMMAcQ5vVa+dGNV3x4dXs="},
{"a2d8i6a7", "{SHA}w5xupnv3GzEjrZeRTaN/BAIwZG0="},
{"gvs9ptc", "{SHA}5i89qVd8KDVGIj/6WCs42qiLz78="},
{"Pookie", "{SHA}dyfp5ehLdcgD8DV5OTPFMOgapMw="},
{"lorissss", "{SHA}nPBPyIWbALLxg9JZQfsMjS4RcwU="},
{"ess", "{SHA}Uk8l/rcR+Og3uJP/+q604N8MY40="},
{"sparra", "{SHA}hIoJ2Qv4wRE3IOC0T+2PhtuhIRs="},
{"allysson", "{SHA}zoSpRZj3pbSShQ9O/SQs+72Let8="},
{"99128008", "{SHA}6LIl/XA9I2XAqwjj2oyYbAGtbOE="},
{"evisanne", "{SHA}+04wmC0awrfmGiRG+HJXjzB3ksw="},
{"qfxg7x9l", "{SHA}8ppTyzpxZSWxqsnvxLtFJrvJV0E="},
{"03415", "{SHA}7D+UYPYha3+V5/PRn2lmCoLkE3E="},
{"87832309", "{SHA}DdMdedbyWGN2wXXkFEiaq0aH9r4="},
{"816283", "{SHA}apgv+JsqqKiGnwxX93atjb/XRDU="},
{"banach12", "{SHA}7k3SGIwIJzTmBgFXSlJuO7OvLx8="},
{"sjdszpsc", "{SHA}jTKQDFGg8jCZfA7Z7NTvF9ayFNQ="},
{"changsing", "{SHA}9Ugo2jB2WaxPh24gPzBGY1zk8XA="},
{"56339388", "{SHA}VziiTWLQk/9DswnexDFgWnA0i7Q="},
{"52114157", "{SHA}4DANwobCvUtq/rIntyXbGBRx1Ag="},
{"jinebimb", "{SHA}3Hrb7SJv64iKtC6+p/hkSwt7DqI="},
{"erol43", "{SHA}mhvtao9e4qlisxYyuFvpiDgk9AA="},
{"2yagos", "{SHA}gOUVpYSGfZS2G1e1ETbr9xh3s2w="},
{"habparty!", "{SHA}uwszyh+dmQGG7TTF+og53Ktkoxs="},
{"tangjianhui", "{SHA}aARgf7klVi/pz8VN86UyQTGzz1Q="},
{"serandah", "{SHA}zsl2jAqcqruDzXNA8N0mSLUZbzY="},
{"mirrages", "{SHA}UTUesDbSS6/GgPE9iZf3lrCWZTQ="},
{"mantgaxxl", "{SHA}l7my97BzljjfxmBiJckh4YSyb98="},
{"45738901", "{SHA}BvqybCxPG+FdshJEASmykXCKFJs="},
{"g523minna", "{SHA}8vtQDuXJUEzst96ogzkYvG8uxng="},
{"j202020", "{SHA}Kdw33gVp/H9JnSZLlWsnPsima8k="},
{"g@mmaecho", "{SHA}pngHweDVwzvWLbkxKI0jpOFMTM8="},
{"042380", "{SHA}BVd3k63K6BSYJK1B/hjI8yNXfN0="},
{"ASRuin", "{SHA}smmoa8r9gdt2lp7HcRV2K5/IIIc="},
{"061990", "{SHA}mQqcr8Htt8OdiJfi6ZATYKrThEY="},
{"ysoline", "{SHA}+r2NvWFQ5X+4vorvec9K2mFDuOE="},
{"liuzhouzhou", "{SHA}sEmnRhZegMdBDNnYnyVB47TeLdg="},
{"b0000000wind", "{SHA}aSdcYgX9Dm3KW/Za/tlT57vxgEs="},
{"7913456852", "{SHA}Mw6kTqFaODDOJj5VpTT2ch/YmeE="},
{"9008", "{SHA}VUcPEIUzSnM4hAcg6rxZjmLVDJ0="},
{"waitlin11", "{SHA}ZLBhQrXPeeuv1cCPi+7jJPxgXVI="},
{"8fdakar", "{SHA}n3eCpjIH9zhOq8ZPlEXJu6p7z+4="},
{"eisball", "{SHA}rV5kTR4QT6OUb5x34+U4V7KCLaY="},
{"jenna17", "{SHA}7p5fBYB+sDLAAUlXN7mRGpplD68="},
{"belkadonam", "{SHA}cTgM/9Qsi2NMwHIVfkRcURDXsdc="},
{"tfyuj9JW", "{SHA}yxMuwJUB/2qDA4nryzDaWwDTwkw="},
{"nihaijidema", "{SHA}eRz741UJnWDv3as1Zr2hXD+V5NY="},
{"talapia", "{SHA}cgoLdQ4IZQJsWhuAk+JCTQ8t9ro="},
{"7376220", "{SHA}fySbHcTbxJwfik52qAUS8rI+hzo="},
{"c7m8e1xsc3", "{SHA}lzR3In34RL83gu8qY87y0YHheew="},
{"84129793", "{SHA}15alyIIv299z3WG9HSMyypwPHrk="},
{"test1000", "{SHA}d6DZQ826zlJxap75+uEuReJ4jTk="},
{"ecmanhatten", "{SHA}7KJnN2t/mNwfOL+l3iWaxOhxoTM="},
{"EvanYo3327", "{SHA}vM6SgURZ4FWN09Qkhg9GKfYNlvI="},
{"269john139", "{SHA}Opk05mxS7TatlO37aS/U9IIVQ8g="},
{"3348159zw", "{SHA}C9q9Bn45z0QrZmQ39373SmzvDIU="},
{"lu184020", "{SHA}kVVGcThWup+til7v26KfKky9tF0="},
{"aszasw", "{SHA}8vG8fcwUCtnsSxWNTQOZyjmMN9U="},
{"33059049", "{SHA}rTkBT+vWAX8AkrMCneVIoGWMPIs="},
{"li3255265", "{SHA}4z+IIfZ6CC3UooUH+pntq40RGLU="},
{"kerrihayes", "{SHA}97ep9vYDA8k3ULenovM1JUP/ZuM="},
{"0167681809", "{SHA}4LkUGAH8SUWCmhpgSR+UoVEuoIU="},
{"stefano123", "{SHA}VMb2w8BIouL+pnejIpju4YvSFrA="},
{"15054652730", "{SHA}TDOwuWHnpr8IWec4G4BV0C1dugY="},
{"natdvd213", "{SHA}YU7zF05TgscOFcJyYpoQqYEsYZU="},
{"680929", "{SHA}0q/yO/YHEg+nTHaZj9wUMpYXc8U="},
{"steelpad8", "{SHA}XRyWxrZ4CYOdZetXUtoBNOYBgkA="},
{"374710", "{SHA}B9utQxyZ22KOIV5ucDFQOQBHOmI="},
{"394114", "{SHA}pBSxqpqhhW+Gwpq+mPNsstCr8tM="},
{"24347", "{SHA}lLeRG7AY/3SvGfvIWXrJLuAFLHo="},
{"krait93", "{SHA}QzZbE1LP+9XcLOc+2FxJuydCQZY="},
{"5164794", "{SHA}Ycbe25pEYtUEXhwcEhb4KQjdJmU="},
{"rswCyJE5", "{SHA}bIPx+G5TLj+NPl0MfyVy85moTJ8="},
{"31480019", "{SHA}ooI9TrVVE7LkLKm5UWwTZT5NDW4="},
{"19830907ok", "{SHA}bEIqh9ertcOn4weApT0AoOM04oU="},
{"zlsmhzlsmh", "{SHA}o51ovielNeyLtb8WuWL0r4PNXus="},
{"Zengatsu", "{SHA}kJDexedKxfHbXeo9MDBUZgagMJA="},
{"0127603331", "{SHA}Q5t2BVGrnc6e0WXfX3dmgPeFdw8="},
{"axelle77", "{SHA}2gUrA8RSDeAsBqTLEjZdaMn+jgo="},
{"password2147", "{SHA}7/hIGwVORnrIkQ45Kam+1bQAvzg="},
{"olixkl8b", "{SHA}Ys9f3svSIg9qsti6VK/KO73Whyw="},
{"maiwen", "{SHA}wFrYvAKCXwBKqeLvEN/vpLPDqiY="},
{"198613", "{SHA}jCtBfLQYgycvbgwtlsTk0RaBcyk="},
{"s17kr8wu", "{SHA}1ndFd2yaVGQ++IN3o4s7nhmJd6c="},
{"biker02", "{SHA}3xG++i1ZRHjEAMWIwuLa/lln4Os="},
{"m1399", "{SHA}lFkJRnfrNTNxWWwLVuS4TDdDT2g="},
{"a2dc6a", "{SHA}xuNHuDtaTcimJJfoic1iM5V3+74="},
{"zhd8902960", "{SHA}OZ1xZJTVdEVVKSOYEUWsJInUxoY="},
{"parasuta", "{SHA}LqofIkTgPad+sr0Qfmh5xmd7F7k="},
{"the1secret", "{SHA}tzixFK8WpqP0bM0qS5sLHEurrm8="},
{"teddy14", "{SHA}H3PBIct3rsU9JIPys8flehjPd3A="},
{"4516388amt", "{SHA}HINCI2ECClS+2vjbEyE/KBDrz08="},
{"245520", "{SHA}T2K08XkQmxOIIFMxN7QN/dHtaXk="},
{"D34dw00d", "{SHA}mMOZxFazBwasFq0MdAVvMQw5b30="},
{"officiel", "{SHA}BrQDy1wpNzHm2EYj20X3PWbtGIc="},
{"36653665", "{SHA}POdeGoaJ4u9dDL7+1aSpKG7u7Jo="},
{"hipol", "{SHA}J+YDaKhmEbjYz71UaVshKoCxg7c="},
{"Nylon0", "{SHA}g9Gphl4ckCSIFal2qP1G+WyIWIs="},
{"caitlyne6", "{SHA}swnIE5GKm3qcHsCdYAVlR9vfldM="},
{"dogzilla", "{SHA}cu8KAzVlpHUeCIDL3dDmhoZwu9k="},
{"lemegaboss", "{SHA}oDyWybc7jVPlmqA+e+F4t/thfRA="},
{"c0valerius", "{SHA}8Y2mGtCTaGznCWYhA/K+XrejBB4="},
{"liseczek44", "{SHA}digyAvFugxt+pDECZ/1XMyHysGo="},
{"saulosi", "{SHA}huAd/hD7INmNYaTrOKbS4auA4Yk="},
{"53522", "{SHA}JK5NmoqlEpzEtwI8cyILiMh710w="},
{"ajgebam", "{SHA}t/RpkDJt44MYi97pB25RABGCTdw="},
{"freshplayer", "{SHA}FW+1cwXfHQtLjBjt9EkBNwnuHnY="},
{"logistica1", "{SHA}jTj0t+mHSGoxWFexu7ac+v8nHCQ="},
{"12calo66", "{SHA}cKdPr0oYieZ1qSvGpMk7G6hB7mw="},
{"kenno", "{SHA}7rCX8u5lLwCcAzDReeSjlU/QkgI="},
{"34639399", "{SHA}r8kaguSOy20qHsPRkQ2uMzKasM8="},
{"0408636405", "{SHA}V7Hjc5P/zB+sxHcqKPkgyodAFT4="},
{"weezer12", "{SHA}YR60ptREeIpQv0B4cho/t2kzODw="},
{"9888735777", "{SHA}zwfYrgeJ508R2yvS/SdyZPNUuw0="},
{"7771877", "{SHA}pKvhH74q06+iWSbsIg9jOqLIOuw="},
{"6620852", "{SHA}LYBr5lIErSckQ/wKA3+YEZin728="},
{"98billiards", "{SHA}eXKk+N0xbstCZ6FV28J/XtVSYiY="},
{"angelik", "{SHA}k80oUNvldNqQwDvS7n9/U7uqyAA="},
{"86815057", "{SHA}nOQ2Wjlc5BGlvX5BfN+RMbH+mKg="},
{"p16alfalfa", "{SHA}O6wvUOWKPtROfqtXZ4TMjlJ/Eqw="},
{"7236118", "{SHA}G1oAkkte9vKp330iZKVnwoyV/FE="},
{"glock17l", "{SHA}6Fys40HEBJYb58Xk4MEa3dYmfh0="},
{"sigmundm", "{SHA}V0QFZ76ISexnBTXJNn4egImklsI="},
{"ltbgeqsd", "{SHA}O5XnrX44sxaey9uUvGLkJQXthkw="},
{"wqnd8k2m", "{SHA}uYqLu0+hCAVauHxHhHj9S8K6dLQ="},
{"yangjunjie", "{SHA}bNXP45UPcI6hnkXMm9XNE4LncRc="},
{"manjinder", "{SHA}u4yMsvZEFcal38qQSk6pK/YeljY="},
{"nick2000", "{SHA}5xFv7yRZIk605O6D1cn52caIorY="},
{"193416", "{SHA}eMiZn8p3ZPwXjrzScxmVZDo5W6s="},
{"pang168", "{SHA}kjiXjei7Tjszq9RunSYjJ++OUHM="},
{"454016", "{SHA}TPcur6LmXg4W+FcHKhC2JVIDnwI="},
{"phair08", "{SHA}2EckYONFyUcDEqgkPhbfah9cHK8="},
{"10252007cw", "{SHA}/3sW+7ineIj1jOU0Dby9nP3ZspA="},
{"zhuzhuzhu", "{SHA}9mONNF7CArnydjmwkhfQebkGaOo="},
{"metafunds", "{SHA}rGImsJEm0Pd8fbE40OBmP6VGfIY="},
{"smash", "{SHA}Mf6CeupM9fas594sId4LX2t4OFg="},
{"76387638", "{SHA}HxRugr3cGBjQB75CJ9urfWG9YSI="},
{"S226811954", "{SHA}Nh+ikcGOUUgInrJh0iHlVlBmsrw="},
{"mintymoo00", "{SHA}3BrwZ+qGvcyFB/Lc/XDfOFWwxXQ="},
{"seven711", "{SHA}8mvvCcUzMnsapzC953/XCxfOT+8="},
{"924414", "{SHA}3X/lD6ATcOaRHopH+6m27+LVeIM="},
{"changchengxu", "{SHA}Ttiw09bDmyeY/YhY0H/YX6MrHWY="},
{"alaska58", "{SHA}wpd/t9fl65nDq3cSCmRYwv9v65E="},
{"7678208", "{SHA}pltR0K3LNrS/qOcwZjzTlXpmw+U="},
{"szazsoo73", "{SHA}mU+OEwW2NBcebLfRPZ9C/Ki0vCI="},
{"3830371", "{SHA}sOfYGqpAMRqXD4e69F6oH3IrqRc="},
{"0qdzx66b", "{SHA}IjbOYS0WcCo0Op0Sz+ETYSVmHNA="},
{"09124248099", "{SHA}e61WLuSD9xNufpbU1Y8wKlgupXM="},
{"bachrain", "{SHA}3Z41BvXKnswJCMrPj94Xj3Lmd0s="},
{"sJsSdFBY", "{SHA}p96d7T+S9V6V8NuYLF679N35qHA="},
{"676215000", "{SHA}yqC6+2MiJondbEaBtxMBn0X81Zw="},
{"nimamapwoaini", "{SHA}cC4wcJtLGRSHKlIqwkr72t9/b9w="},
{"nitsuj", "{SHA}hgNZhLC7ZcfxDef0KFz/xEabK+E="},
{"cukierek2003", "{SHA}ptbHX+v+J4WVRvM9a2tlWTOIjaQ="},
{"seeder", "{SHA}ls+1/MdSymeKHyVoU6OJ2n9VF2s="},
{"00167148786", "{SHA}oRqSqk2/YvT0NNWY9M9ejSNRWms="},
{"ashok198", "{SHA}mFHUN4xN0yWhXLeHSeRxPFXNIUA="},
{"kt2116", "{SHA}W0GRYxTwoVnywElvbpwdNR0wEmk="},
{"another82", "{SHA}CVVbc3vnDGApFxvmTX+/4WUErnE="},
{"75995794", "{SHA}pKxQI+Q6WmVal5D8XMAy9c3jEyM="},
{"19901130", "{SHA}C91rFij4vkgcUZisF7TTcpMUFKA="},
{"gijs010389", "{SHA}nyzMGhYQfLMBCG7rBtXnbj0bF0Y="},
{"26263199", "{SHA}hw69n/v0JJf7Z1UK0hn6NcQOiMY="},
{"hi1j42x8", "{SHA}iTz0n/olV3SiPW9zQX2v2/sYZHE="},
{"6922235", "{SHA}NM/XeJbQkI57FPhUn0pU4pV6tYc="},
{"67749330", "{SHA}ws12wS7j4dCN+IItHQi8SZS00kc="},
{"ccpatrik", "{SHA}HhYw12y7WG8xahUNKf4MHlUPitA="},
{"summer3011", "{SHA}KrCi609b3nk3uKVCgw76/cbsAZc="},
{"331516", "{SHA}uSyZbnpZu1t1TsvoUyp4TsQvePs="},
{"135745", "{SHA}oLBO8TyN9/yjytrlYF6NW0o6He0="},
{"603762004", "{SHA}axYN5gmBWHFLDMoMf4Oj/t4ND9I="},
{"29011985", "{SHA}KdFYg6fHUtb8tvbRWak+g+kyk/A="},
}
func Test_Sha(t *testing.T) {
for _, v := range shaTestData {
testParserGood(t, "sha", AcceptSha, RejectSha, v.hashed, v.password)
}
testParserBad(t, "sha", AcceptSha, RejectSha, "{SHA}Ys23Ag/5IOWqZCw9dHwH00=")
testParserBad(t, "sha", AcceptSha, RejectSha, "{SHA}plaintext")
testParserNot(t, "sha", AcceptSha, RejectSha, "plaintext")
}