tags:

views:

88

answers:

4

Possible Duplicate:
how to prevent your javascripts being stolen,copied, and viewed ?

Hi

What is the best way to secure the javascript code & make it hard to understand it and for sure steal it... I know that its impossible to secure it 100% since its client side and all the code the client can see it.. But I need to make it as hard as possible...

thanks alot Guys..

//----------------------------- Added ------------------------

there is a site that used a new way to secure the javascript code using the regular expression.. is there is a way to see the code easily ?? is it safe to do that method?? and how to do it, if its hard to do it?? http://samy.pl/

+3  A: 

All you can do is minify and obfuscate it.

Here is a free obfuscator, there are several around.

Tom Gullen
A: 

First, obfuscate it - change functions/variables names to meaningless names. Then pack it using the packer.

Sergei
If do that.. obfuscate it then packer it... is it easy to deobfuscate it.. or it needs time to do that ??I use the tool that "Tom Gullen"(Thank u ;) ) mention it ..
Q8Y
Q8Y
+1  A: 

100% securing of JS code is impossible. Whichever popular packer you use, JSBeautifier is usually able to reconstruct a humanly-readable source from it. Personally, I only use Google Closure Compiler which is the best minifier/optimizer currently available.

Onestone
if its impossible 100%... how can i make it at least harder for normal user ?? since no matter what I obfuscate it, http://jsbeautifier.org/ will do the trick and deobfuscate it :) it will take a second to do that :)and for the Google Closure Compiler. they said that it only make your code run faster, they didn't mention any thing for securing and encrypting !!What should I do ?? I just want it hard for a normal user to see it, since the hacker no matter what I did they will see it eventually :)
Q8Y