View Full Version : How to protect .js from download
houssem-hj
May 10th 2008, 4:11 pm
Hi everybody.
I have a .js file in one website, I don't want that this file can be downloaded or be shown in the source code of the file.
I tried to protect the folder by an .htaccess file, with this solution i see that even the website can not use the script.
Someone have an idea ??
Thanks for your reply.
Regards.
Logic Ali
May 11th 2008, 5:37 am
Hi everybody.
I have a .js file in one website, I don't want that this file can be downloaded or be shown in the source code of the file.
If a site uses a script, it has to download it; once downloaded it can always be accessed.
Alex Polski
May 11th 2008, 6:17 am
You can only encode .js-file, because javascript runs on client side but not server side.
dzdrazil
May 11th 2008, 8:59 pm
would it be possible to use something server-side instead of java? php or so?
crath
May 12th 2008, 6:46 pm
Javasource is a Client Side scripting language. This means that it must be downloaded to the viewers computer to be compiled and run. You can use things such as AJAX to pass data between server side languages such as PHP and javascript, to keep security and interactivity balanced.
hotmarket
May 12th 2008, 8:00 pm
Try use referer check,but here only forbid direct to download,if the man use tool,here still can't work ok!
GreatMetro
May 12th 2008, 10:42 pm
Try:
http://dean.edwards.name/packer/
crath
May 13th 2008, 4:16 am
Try:
http://dean.edwards.name/packer/
it just puts all the lines on the same line, that just slows them down about... 20 seconds
vpguy
May 14th 2008, 3:05 am
it just puts all the lines on the same line, that just slows them down about... 20 seconds
Nonsense. It hardly slows it down at all. I use Packer on all of my scripts. If it slows down your script by 20 seconds, then your script needs some serious rewriting - it's not the tool that is to blame.
To answer the OP's question: it cannot be done. Lots of people have tried lots of ridiculous things, but Javascript can only be obfuscated. Obfuscated code can quickly and easily be converted into the original source code.
crath
May 14th 2008, 6:29 am
It will only slow down the people trying to get the code about 20 seconds, it will not slow down the scripts.
vpguy
May 14th 2008, 2:55 pm
It will only slow down the people trying to get the code about 20 seconds, it will not slow down the scripts.
Ah... now I understand, and completely agree.
kmap
May 14th 2008, 3:02 pm
you can encode it instead of hiding
Javascript coders programs are available ,they just make it unreadable
Regards
Alex
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.