Forum Moderators: open

Message Too Old, No Replies

Obfuscation of code

Tools for the job?

         

jaxz

11:05 am on May 28, 2006 (gmt 0)

10+ Year Member



How do I best use Obfuscation to prevent code-jacking of my javascripts?
What tools are useful for this?

And, the corollary, what tools do sneaky web masters use to decrypt such protected code?

Thanks,
Jaxz

texmex

7:08 pm on May 28, 2006 (gmt 0)

10+ Year Member



Move as much of your scripting as possible, to the server side. Obfuscation tends to cost more time to implement than it's worth.

Since you can NEVER prevent client side scripts being ripped off, it may be worth your while putting a note on your site, that anyone reusing your code should include a link to your site.

I make a point of including credit where it's due. Doubt I'd do the same if I'd had to hack into it in the first place.

Being realistic, no matter how brilliant you think your own code is, there are probably full instruction on how to achieve exactly the same results, freely available on the internet. It's easier to find such instructions and use them, than download the code from an existing site (such as yours), and reverse engineer it.

dc_2000

1:11 am on May 29, 2006 (gmt 0)

10+ Year Member



I agree with texmex. By the way, I had the same question recently and I made some research online.

What I learned for myself is that it's better to "compress" the code, rather than "obfuscate" it, to make it faster to load and well, harder to read and interpret by a human being. (By compression I mean removing all unnecessary spaces, line feeds, comments, changing variable names.) And again repeating what texmex had said, even if some products swear to encrypt your code -- IT IS NOT TRUE!

As for tools to use, I personally like two:
javascript obfuscator
scripts encryptor

Both are shareware and I'd favor the latter one as it costs less and is more easy to use and allows to compress HTML as well. There are also free sites that offer to do everything on-line, but they are not as thorough as those two programs. I'm not giving any links not to make a free commercial. Google for them yourself.

Let me know if you find something else?

jaxz

6:54 am on May 30, 2006 (gmt 0)

10+ Year Member



Regarding obfuscation of JavaScript – I do realize that any client side script must be in a valid format for running in the browers, so little more than removing white space and changing variable names can be done to mystify the source script.

But does that make much of a difference really? I mean, for instance all opening and closing parenthesis containing related operations must remain intact. These must be easy to match up and thus reveal the structure of the script even if it’s just a few very long lines. Correct?

Thx,
Jaxz