14

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

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...

1

3 Answers 3

9

All you can do is minify and obfuscate it.

Here is a free obfuscator, there are several around.

Sign up to request clarification or add additional context in comments.

Comments

4

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

2 Comments

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 ..
Also... Someone, told me a really also nice way to secure the code.. by securing the obfuscate with a key... I mean securing the secured already :) is it possible to do that, secure the code with a key & obfuscate it ?? thanks very much Guys, for ur help
3

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.

1 Comment

if its impossible 100%... how can i make it at least harder for normal user ?? since no matter what I obfuscate it, 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 :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.