Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to secure the Javascript Code? [duplicate]

Tags:

javascript

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

like image 987
Q8Y Avatar asked Aug 09 '10 09:08

Q8Y


3 Answers

All you can do is minify and obfuscate it.

Here is a free obfuscator, there are several around.

like image 154
Tom Gullen Avatar answered Oct 31 '22 15:10

Tom Gullen


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

like image 34
Sergei Avatar answered Oct 31 '22 16:10

Sergei


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.

like image 3
Onestone Avatar answered Oct 31 '22 16:10

Onestone