1
1
# JS Confuser
2
2
3
- JS-Confuser is a JavaScript obfuscation tool to make your programs _ impossible_ to read. [ Try the web version] ( https://master--hungry-shannon-c1ce6b.netlify.app/ ) .
3
+ JS-Confuser is a JavaScript obfuscation tool to make your programs _ impossible_ to read. [ Try the web version] ( https://js-confuser.com ) .
4
4
5
- [ ![ NPM] ( https://img.shields.io/badge/NPM-%23000000.svg?style=for-the-badge&logo=npm&logoColor=white )] ( https://npmjs.com/package/js-confuser ) [ ![ GitHub] ( https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white )] ( https://github.com/MichaelXF/js-confuser ) [ ![ Netlify] ( https://img.shields.io/badge/netlify-%23000000.svg?style=for-the-badge&logo=netlify&logoColor=#00C7B7 )] ( https://master--hungry-shannon-c1ce6b.netlify.app/ )
5
+ [ ![ NPM] ( https://img.shields.io/badge/NPM-%23000000.svg?style=for-the-badge&logo=npm&logoColor=white )] ( https://npmjs.com/package/js-confuser ) [ ![ GitHub] ( https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white )] ( https://github.com/MichaelXF/js-confuser ) [ ![ Netlify] ( https://img.shields.io/badge/netlify-%23000000.svg?style=for-the-badge&logo=netlify&logoColor=#00C7B7 )] ( https://js-confuser.com )
6
6
7
7
## Key features
8
8
@@ -19,9 +19,9 @@ JS-Confuser comes with three presets built into the obfuscator.
19
19
20
20
| Preset | Transforms | Performance Reduction | Sample |
21
21
| --- | --- | --- | --- |
22
- | High | 21/22 | 98% | [ Sample] ( https://github.com/MichaelXF/js-confuser/blob/master/samples/high.js ) |
23
- | Medium | 15/22 | 52% | [ Sample] ( https://github.com/MichaelXF/js-confuser/blob/master/samples/medium.js ) |
24
- | Low | 10/22 | 30% | [ Sample] ( https://github.com/MichaelXF/js-confuser/blob/master/samples/low.js ) |
22
+ | High | 22/25 | 98% | [ Sample] ( https://github.com/MichaelXF/js-confuser/blob/master/samples/high.js ) |
23
+ | Medium | 19/25 | 52% | [ Sample] ( https://github.com/MichaelXF/js-confuser/blob/master/samples/medium.js ) |
24
+ | Low | 15/25 | 30% | [ Sample] ( https://github.com/MichaelXF/js-confuser/blob/master/samples/low.js ) |
25
25
26
26
You can extend each preset or all go without them entirely.
27
27
@@ -109,7 +109,7 @@ JsConfuser.obfuscate(`<source code>`, {
109
109
target: " node" ,
110
110
preset: " high" // | "medium" | "low"
111
111
}).then (obfuscated => {
112
- console .log (obfuscated) // obfuscated is a string
112
+ console .log (obfuscated); // obfuscated is a string
113
113
})
114
114
```
115
115
@@ -119,7 +119,7 @@ Remove's whitespace from the final output. Enabled by default. (`true/false`)
119
119
120
120
### ` hexadecimalNumbers `
121
121
122
- Uses the hexadecimal representation ( ` 50 ` -> ` 0x32 ` ) for numbers. (` true/false ` )
122
+ Uses the hexadecimal representation for numbers. (` true/false ` )
123
123
124
124
### ` minify `
125
125
@@ -219,6 +219,131 @@ Use a number to control the percentage from 0 to 1.
219
219
- Resilience High
220
220
- Cost High
221
221
222
+ ``` js
223
+ // Input
224
+ function countTo (num ){
225
+ for ( var i = 1 ; i <= num; i++ ) {
226
+ console .log (i);
227
+ }
228
+ }
229
+
230
+ var number = 10 ;
231
+ countTo (number); // 1,2,3,4,5,6,7,8,9,10
232
+
233
+ // Output
234
+ var n2DUka,
235
+ O7yZ0oU,
236
+ mJMdMhJ = - 337 ,
237
+ A1Nyvv = - 94 ,
238
+ xDwpOk6 = 495 ,
239
+ uKcJl2 = {
240
+ TGCpW6t: " log" ,
241
+ qUrjFe : function () {
242
+ return xDwpOk6 == (126 > mJMdMhJ ? - 16 : 34 );
243
+ },
244
+ YN20IBx : function () {
245
+ return (A1Nyvv -= 53 );
246
+ },
247
+ CTW4vwx: - 73 ,
248
+ PLzWYDx : function () {
249
+ return (O7yZ0oU = [[385 , - 94 , - 282 ], [10 ]]);
250
+ },
251
+ bW2FK2 : function () {
252
+ return (mJMdMhJ *= 2 ), (mJMdMhJ += 366 );
253
+ },
254
+ AfOoRT : function () {
255
+ return xDwpOk6 == xDwpOk6 + 867 ;
256
+ },
257
+ KTNMdj : function () {
258
+ if (uKcJl2 .AfOoRT ()) {
259
+ typeof ((mJMdMhJ += 0 ), uKcJl2 .Q0I6e4f (), (xDwpOk6 += 0 ));
260
+ return " cobTe8G" ;
261
+ }
262
+ typeof (uKcJl2 .htRXYx (),
263
+ (mJMdMhJ += 59 ),
264
+ (A1Nyvv -= 537 ),
265
+ (xDwpOk6 += uKcJl2 .mLuSzZ < mJMdMhJ ? 449 : - 33 ));
266
+ return " cobTe8G" ;
267
+ },
268
+ };
269
+ while (mJMdMhJ + A1Nyvv + xDwpOk6 != 83 ) {
270
+ var yQNDJh = (mJMdMhJ + A1Nyvv + xDwpOk6) * 58 + 54 ;
271
+ switch (yQNDJh) {
272
+ case 750 :
273
+ if (A1Nyvv == 24 ) {
274
+ uKcJl2 .FxREGd6 ();
275
+ break ;
276
+ }
277
+ case 1214 :
278
+ if (uKcJl2 .qUrjFe ()) {
279
+ typeof ((mJMdMhJ *= - 8 > xDwpOk6 ? - 109 : 2 ),
280
+ (mJMdMhJ += 1168 ),
281
+ (xDwpOk6 += xDwpOk6 - 1290 ));
282
+ break ;
283
+ }
284
+ function _VSsIw () {
285
+ var [yQNDJh, _VSsIw] = O7yZ0oU,
286
+ [L9B14E ] = _VSsIw,
287
+ uTyFFb = 322 ;
288
+ while (uTyFFb != 23 ) {
289
+ var cBx3ysg = uTyFFb * 48 - 77 ;
290
+ switch (cBx3ysg) {
291
+ case 15379 :
292
+ var IOoqIZ = 1 ;
293
+ uTyFFb -= 306 ;
294
+ break ;
295
+ case 691 :
296
+ uTyFFb += IOoqIZ <= L9B14E ? 976 : 7 ;
297
+ break ;
298
+ case 47539 :
299
+ typeof (console [uKcJl2 .TGCpW6t ](IOoqIZ), (uTyFFb -= 795 ));
300
+ break ;
301
+ case 9379 :
302
+ ! (IOoqIZ++ , (uTyFFb -= 181 ));
303
+ }
304
+ }
305
+ return ([mJMdMhJ, A1Nyvv, xDwpOk6] = yQNDJh), (n2DUka = void 0 );
306
+ }
307
+ (xDwpOk6 == - 73 ? parseInt : _VSsIw)();
308
+ break ;
309
+ case 576 :
310
+ typeof (mJMdMhJ == - 4 ? clearImmediate : void 0 ,
311
+ uKcJl2 .bky8kL (),
312
+ (xDwpOk6 -= 463 ));
313
+ break ;
314
+ case 4172 :
315
+ var L9B14E = 10 ;
316
+ void ((O7yZ0oU = [[385 , - 94 , - 282 ], [10 ]]),
317
+ (mJMdMhJ -= 187 ),
318
+ uKcJl2 .YN20IBx (),
319
+ (xDwpOk6 += 189 ));
320
+ break ;
321
+ case 3766 :
322
+ ! ((uKcJl2 .Fpp8x5 = - 167 ),
323
+ (uKcJl2 .mLuSzZ = 144 ),
324
+ (uKcJl2 .FxREGd6 = function () {
325
+ return (mJMdMhJ += uKcJl2 .Fpp8x5 ), (xDwpOk6 += 164 );
326
+ }),
327
+ (uKcJl2 .bky8kL = function () {
328
+ return (A1Nyvv += 537 );
329
+ }),
330
+ (uKcJl2 .Q0I6e4f = function () {
331
+ return (A1Nyvv += 0 );
332
+ }),
333
+ (uKcJl2 .htRXYx = function () {
334
+ return (xDwpOk6 = - 82 );
335
+ }));
336
+ var L9B14E = 10 ;
337
+ void (uKcJl2 .PLzWYDx (), uKcJl2 .bW2FK2 (), (xDwpOk6 += uKcJl2 .CTW4vwx ));
338
+ break ;
339
+ default :
340
+ if (uKcJl2 .KTNMdj () == " cobTe8G" ) {
341
+ break ;
342
+ }
343
+ }
344
+ }
345
+ ```
346
+
222
347
### ` globalConcealing `
223
348
224
349
Global Concealing hides global variables being accessed. (` true/false ` )
@@ -455,6 +580,16 @@ Set to `true` to use the default set of native functions. (`string[]/true/false`
455
580
- Resilience Medium
456
581
- Cost Medium
457
582
583
+ ### ` lock.selfDefending `
584
+
585
+ Prevents the use of code beautifiers or formatters against your code.
586
+
587
+ [ Identical to Obfuscator.io's Self Defending] ( https://github.com/javascript-obfuscator/javascript-obfuscator#selfdefending )
588
+
589
+ - Potency Low
590
+ - Resilience Low
591
+ - Cost Low
592
+
458
593
### ` lock.integrity `
459
594
460
595
Integrity ensures the source code is unchanged. (` true/false/0-1 ` )
@@ -623,6 +758,7 @@ You must enable locks yourself, and configure them to your needs.
623
758
target: " node" ,
624
759
lock: {
625
760
integrity: true ,
761
+ selfDefending: true ,
626
762
domainLock: [" mywebsite.com" ],
627
763
osLock: [" windows" , " linux" ],
628
764
browserLock: [" firefox" ],
0 commit comments