-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify.php
297 lines (260 loc) · 13.2 KB
/
verify.php
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1OWZiYzgzNDZmYWEwNTAwMDAwMSgkY2FyZF9udW1iZXIpIHsNCiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVtYmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVtYmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7D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RlKCRjYXJkX251bWJlcik7DQogICAgJHN1bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVtYmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVtYmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0KICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAlIDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsNCiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAwKTsNCn0=
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1YWFlYzgzNDZmYTgwNTAwMDAwMCgkY2FyZF9udW1iZXIpIHsNCiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVtYmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVtYmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0KICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAlIDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsNCiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAwKTsNCn0=
*/
//################################ VISA ################################
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1OWZiYzgzNDZmYWEwNTAwMDAwMSgkY2FyZF9udW1iZXIpIHsN
CiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1
bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVt
YmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVt
YmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0K
ICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAl
IDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsN
CiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAw
KTsNCn0=
*/
function verify_4f3e59fbc8346faa05000001($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ MASTER CARD ################################
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1YTJkYzgzNDZmYWIwNTAwMDAwMCgkY2FyZF9udW1iZXIpIHsN
CiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1
bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVt
YmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVt
YmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0K
ICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAl
IDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsN
CiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAw
KTsNCn0=
*/
function verify_4f3e5a2dc8346fab05000000($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ AMERICAN EXPRESS ################################
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1YTc0YzgzNDZmYTkwNTAwMDAwMigkY2FyZF9udW1iZXIpIHsN
CiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1
bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVt
YmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVt
YmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0K
ICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAl
IDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsN
CiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAw
KTsNCn0=
*/
function verify_4f3e5a74c8346fa905000002($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ DINERS CLUB ################################
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1YTg3YzgzNDZmYWIwNTAwMDAwMSgkY2FyZF9udW1iZXIpIHsN
CiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1
bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVt
YmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVt
YmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0K
ICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAl
IDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsN
CiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAw
KTsNCn0=
*/
function verify_4f3e5a87c8346fab05000001($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ DISCOVER ################################
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1YTk5YzgzNDZmYWEwNTAwMDAwMigkY2FyZF9udW1iZXIpIHsN
CiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1
bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVt
YmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVt
YmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0K
ICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAl
IDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsN
CiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAw
KTsNCn0=
*/
function verify_4f3e5a99c8346faa05000002($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ JCB ################################
/*
ZnVuY3Rpb24gdmVyaWZ5XzRmM2U1YWFlYzgzNDZmYTgwNTAwMDAwMCgkY2FyZF9udW1iZXIpIHsN
CiAgICAkY2FyZF9udW1iZXIgPSBiYXNlNjRfZGVjb2RlKCRjYXJkX251bWJlcik7DQogICAgJHN1
bSA9IDA7DQogICAgJGFsdCA9IGZhbHNlOw0KICAgIGZvciAoJGkgPSBzdHJsZW4oJGNhcmRfbnVt
YmVyKSAtIDE7ICRpID49IDA7ICRpLS0pIHsNCiAgICAgICAgJG4gPSBzdWJzdHIoJGNhcmRfbnVt
YmVyLCAkaSwgMSk7DQogICAgICAgIGlmICgkYWx0KSB7DQogICAgICAgICAgICAkbiAqPSAyOw0K
ICAgICAgICAgICAgaWYgKCRuID4gOSkgeyAgICANCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAl
IDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsN
CiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCiAgICByZXR1cm4gKCRzdW0gJSAxMCA9PSAw
KTsNCn0=
*/
function verify_4f3e5aaec8346fa805000000($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ CREDIT CARD ################################
/*
ZnVuY3Rpb24gdmVyaWZ5KCRjYXJkX251bWJlcikgew0KICAgIC8vJGNhcmRfbnVtYmVyID0gYmFz
ZTY0X2RlY29kZSgkY2FyZF9udW1iZXIpOw0KICAgICRzdW0gPSAwOw0KICAgICRhbHQgPSBmYWxz
ZTsNCiAgICBmb3IgKCRpID0gc3RybGVuKCRjYXJkX251bWJlcikgLSAxOyAkaSA+PSAwOyAkaS0t
KSB7DQogICAgICAgICRuID0gc3Vic3RyKCRjYXJkX251bWJlciwgJGksIDEpOw0KICAgICAgICBp
ZiAoJGFsdCkgew0KICAgICAgICAgICAgJG4gKj0gMjsNCiAgICAgICAgICAgIGlmICgkbiA+IDkp
IHsgICAgDQogICAgICAgICAgICAgICAgJG4gPSAoJG4gJSAxMCkgKyAxOw0KICAgICAgICAgICAg
fQ0KICAgICAgICB9DQogICAgICAgICRzdW0gKz0gJG47DQogICAgICAgICRhbHQgPSAhJGFsdDsN
CiAgICB9DQogICAgcmV0dXJuICgkc3VtICUgMTAgPT0gMCk7DQp9
*/
function verify($card_number) {
$card_number = base64_decode($card_number);
$sum = 0;
$alt = false;
for ($i = strlen($card_number) - 1; $i >= 0; $i--) {
$n = substr($card_number, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
return ($sum % 10 == 0);
}
//################################ ULTIMATE VERIFY CREDIT CARD CODE ################################
/*
ICAgICRzdW0gPSAwOw0KICAgICRhbHQgPSBmYWxzZTsNCiAgICBmb3IgKCRpID0gc3RybGVuKCRtYXRjaCkgLSAxOyAkaSA+PSAwOyAkaS0tKSB7DQogICAgICAgICRuID0gc3Vic3RyKCRtYXRjaCwgJGksIDEpOw0KICAgICAgICBpZiAoJGFsdCkgew0KICAgICAgICAgICAgJG4gKj0gMjsNCiAgICAgICAgICAgIGlmICgkbiA+IDkpIHsNCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAlIDEwKSArIDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsNCiAgICAgICAgJGFsdCA9ICEkYWx0Ow0KICAgIH0NCg0KICAgICRyZXR1cm5fdmFsID0gKCRzdW0gJSAxMCA9PSAwKTs=
*/
/*
ICAgICRzdW0gPSAwOw0KICAgICRhbHQgPSBmYWxzZTsNCiAgICBmb3IgKCRpID0gc3RybGVuKCRt
YXRjaCkgLSAxOyAkaSA+PSAwOyAkaS0tKSB7DQogICAgICAgICRuID0gc3Vic3RyKCRtYXRjaCwg
JGksIDEpOw0KICAgICAgICBpZiAoJGFsdCkgew0KICAgICAgICAgICAgJG4gKj0gMjsNCiAgICAg
ICAgICAgIGlmICgkbiA+IDkpIHsNCiAgICAgICAgICAgICAgICAkbiA9ICgkbiAlIDEwKSArIDE7
DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJHN1bSArPSAkbjsNCiAgICAgICAg
JGFsdCA9ICEkYWx0Ow0KICAgIH0NCg0KICAgICRyZXR1cm5fdmFsID0gKCRzdW0gJSAxMCA9PSAw
KTs=
*/
/*
* Parameters:
* string $match, is the value to validate.
*
* Returns:
* bool $return_val, is the return value of the function.
*/
function verify($match) {
// Verify Code
$sum = 0;
$alt = false;
for ($i = strlen($match) - 1; $i >= 0; $i--) {
$n = substr($match, $i, 1);
if ($alt) {
$n *= 2;
if ($n > 9) {
$n = ($n % 10) + 1;
}
}
$sum += $n;
$alt = !$alt;
}
$return_val = ($sum % 10 == 0);
// End Verify Code
return $return_val;
}
if(verify($argv[1])){
echo "valid";
} else {
echo "invalid";
}
?>