Javascript Obfuscators

C++, C#, Java, PHP, ect...

Javascript Obfuscators

Postby Jackolantern » Sat Mar 06, 2010 9:06 am

I figured I would post a couple of the nice JS obfuscators I have found. These can be quite important in PBBG game development so that your players cannot make heads or tails of the code in their browser, while still allowing it to run no problem. It will also run better in some cases, since some obfuscators compress the code, making it download and execute faster.

Free JS Obfuscator: This is a free one, and probably does the weakest obfuscation, but I have included it because it is browser-based and can be used with no download. Just type your code into the code window, hit Obfuscate and then copy'n'paste the code from the bottom window. A large portion of what this one does is just convert a lot of your code to hex. This could slow down some basic users, but it can be fairly easily broken if your code is not very complex (if it is complex, it would be hard to decode because of the loss of organization).

Javascript Obfuscator: Real creative names, huh? Anyway, this is the most powerful obfuscator I have found so far. It is a commercial product, but it is only $40 for a single-user license, and there is a trial to check it out. This one adds new functions, changes function and variable names, and basically turns your code into unapproachable garble while compressing your files by about 25 - 50%. There is absolutely no way to reverse the obfuscation on this version's method. This product also boasts some fairly large names using their obfuscator.
User avatar
Jackolantern
 
Posts: 2116
Joined: Wed Jul 01, 2009 5:00 pm
Location: Houston, TX

Re: Javascript Obfuscators

Postby hallsofvallhalla » Sat Mar 06, 2010 4:49 pm

as far as hiding the code I just include it in a .js file and it hides the source. You just have to pass and declare the php variables on the initial page.
hallsofvallhalla
Site Admin
 
Posts: 4550
Joined: Wed Apr 22, 2009 5:29 pm

Re: Javascript Obfuscators

Postby Jackolantern » Sat Mar 06, 2010 5:35 pm

hallsofvallhalla wrote:as far as hiding the code I just include it in a .js file and it hides the source. You just have to pass and declare the php variables on the initial page.


I would be careful about relying on this method, since there are tools/methods for seeing it even when put in an external file. It obviously has to be transmitting to the client for it to have any effect in their browser, and if it is sent to the user, they can see it is they are motivated to do so. Pretty much all of the major Javascript websites (Amazon, Ebay, Gmail, etc.) rely on obfuscation to protect their code. Of course I can't be sure what they use, but the strength looks similar to the second tool I linked above.
User avatar
Jackolantern
 
Posts: 2116
Joined: Wed Jul 01, 2009 5:00 pm
Location: Houston, TX

Re: Javascript Obfuscators

Postby hallsofvallhalla » Sun Mar 07, 2010 5:23 pm

yeah i guess if someone is committed to getting your code they will do what it takes.
hallsofvallhalla
Site Admin
 
Posts: 4550
Joined: Wed Apr 22, 2009 5:29 pm

Re: Javascript Obfuscators

Postby Jackolantern » Sun Mar 07, 2010 6:16 pm

Of course there is no way to have an unbreakable obfuscator for JS since it still has to be understood by the browser, but it can make it so complex that it is incomprehensible. I will likely be trying out several obfuscators for my game's JS :)
User avatar
Jackolantern
 
Posts: 2116
Joined: Wed Jul 01, 2009 5:00 pm
Location: Houston, TX

Re: Javascript Obfuscators

Postby hallsofvallhalla » Sun Mar 07, 2010 6:29 pm

make sure to right a review for them. I will most likely be looking for one soon.
hallsofvallhalla
Site Admin
 
Posts: 4550
Joined: Wed Apr 22, 2009 5:29 pm

Re: Javascript Obfuscators

Postby Jackolantern » Sun Mar 07, 2010 6:55 pm

I will definitely do that, but I can almost guarantee that I am going to start with that second one I linked above. Their screenshots of obfuscated code look almost just like the source of major JS sites, such as Amazon and GMail. I will write up a review once I have some JS code complex enough to warrant trying it. I believe they also have a free trial, so I will try that out before buying it.
User avatar
Jackolantern
 
Posts: 2116
Joined: Wed Jul 01, 2009 5:00 pm
Location: Houston, TX

Re: Javascript Obfuscators

Postby MAruz » Mon Mar 08, 2010 2:42 am

Halls, if you use external CSS and JS files, all you need to do to see them is "view source", and click on the link for the CSS or JS file in question, and you'll have it in it's complete state. So it's not hidden at all for the players.
PHP, Java, JavaScript, HTML, CSS, XML, MySQL / Oracle
Photoshop, Illustrator
www.cuddly-zombie.com
User avatar
MAruz
 
Posts: 114
Joined: Fri Nov 20, 2009 6:31 am
Location: Oslo, Norway

Re: Javascript Obfuscators

Postby hallsofvallhalla » Mon Mar 08, 2010 8:58 am

um no, doesnt work that way. Unless someone set their attribs wrong on the server maybe.
hallsofvallhalla
Site Admin
 
Posts: 4550
Joined: Wed Apr 22, 2009 5:29 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest