javascript - node.js obfuscate tool for client-side files -


i looking tool or similiar: http://javascriptobfuscator.com/javascript-obfuscator.aspx

but module node.js, can obfuscate client-side js file before sending them.

the tool url above few things important changes strings between quotes , variable names unreadable form.

i've tried write code encoding strings, makes code broken:

var output = str.replace(/(")(([^"\\]|\\.)+)(")/gi, function(match, p1, p2, p3, p4) {      return p1 + someencodingfunc(p2) + p4; }); 

edit:

thanks robertklep i've found confusion module. job. maybe can me issue? https://github.com/uxebu/confusion/issues/1

you can see problem in code output project page:

(function(_x24139) {   a[_x24139[0]](called[_x24139[1]](_x24139[2]));   an[_x24139[3]](_x24139[4], _x24139[5], _x24139[6]); }).call(   this,   ["property", "with", "a string literal", "other", "call", "is", "here"] ); 

all need obfuscate these strings in array. noticed if there utf8 character in string, obfuscate \uxxxx form. utf8. if obfuscate ascii \xyy form well.. characters.

why don't try jscrambler instead?. not has more source code transformations target both strings , control-flow, has bunch of code traps , runtime protection called self-defending. also, worked out of box me. claim compliant every js lib out there , right solution afaik officially supports node.js:
jscrambler compliance report

i don't think uglify option. it's code optimizer, not meant protect code. rename variables , functions, weak of protection consider.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -