Register  |  Login



Question

Status: Closed Points: 125 Time: 17:17 - Aug 30, 2006  

multani.sarbjit

Hiding css and javascript files

HI ,

Is there anyway to hide the css and js files of project so that user can't view it in the browser if somehow user came to know the path of these files of project?. In otherwords can we encrypt these files ?

Any suggestion please!!

Thanks in advance

Regards,
Sarbjit

Answer Discussion
Answer Summaries

 

Q&A System for Websites and Corporate Collaboration

Advertisement

  • Generates significant organic traffic for websites
  • Saves companies money, resources, and time

theDude

Date:: Aug 30, 2006

Time:: 19:27

Hi Sarbjit,

You can't prevent people from downloading the files, but you can encrypt them or obfuscate them if you want it to be difficult for people to see what you've programmed.
I don't know any free scripts to do this, but here are a few links to shareware (they have trial periods) that might be what you're looking for.
http://www.topshareware.com/Advanced-HTM...
http://www.protware.com/default.htm
http://www.exefind.com/encrypt-php/

Let me know if that was what you were looking for.
theDude

multani.sarbjit

Date:: Aug 31, 2006

Time:: 06:19

Thanks theDude,

You got the right things but I want to do in scripting the encryption of these files.

Regards,
Sarbjit

Snyke

Date:: Sep 03, 2006

Time:: 15:23

Maybe the JSLinker of the Dojo project might be the thing you are looking for: it allows you to transfowm your code into an AST which is faster to execute and also obfuscates the code you've written. For CSS I have no idea at all because a good DOM-Inspector can be used to analyze the properties...

http://snyke.net/blog/2006/09/02/js-link...

Regards,
Snyke

webkungfu

Date:: Jun 22, 2008

Time:: 06:04

Hi All,
I was looking at your comments and have the same problem. I use ASP programming and have my JS files in a seperate folder to hide them but when I look at the source code in the browser it obviously displays the path to this folder in my <Script> tag. If I select and copy this path from the displayed source file and paste it into the address bar accordingly it allows me to download the file, so my question would be, is there anyway to password protect this folder to prevent download?

Let it be said also that my JS is very basic, (image over buttons) so it is not important but I would like to find a way to hide these files incase I ever have to deal with sensitive data using JS. I can do this with VB anyway, (run on server), but I would like to prevent as much server lag as possible.

Thanks for your time people.

regards,
James.

jgivoni

Date:: Jul 07, 2008

Time:: 11:08

James,

Don't know if you have already thought about it this way: You can indeed password protect the folder with you script files, to prevent download, but they wouldn't be much good then, since the browser wouldn't be able to see them either. Anything that runs client-side will have to be visible to the client (browser, user, whatever). You can make things difficult for the user by only serving the file if the referer is your web page, but anyone who would have an interest in seeing your secret js-file with sensitive data, will also be clever enough to overcome any kind of obstacle you may present.

If you want to hide script or data, the answer is to run it on the server and never serve it to any client.

Hope it makes sense!
Jakob

Question Answered

This question has been closed, and points have been rewarded to the following experts:

theDude: 75
Snyke: 50

You're welcome however to comment or give additional information or if you wish, you have the ability to write an Answer Summary for the Summary Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No summaries have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top JavaScript Experts

View More

Rank

Expert

Points

1.

nidhi

665

2.

rcastagna

505

3.

jgivoni

428

4.

xarcus

280

5.

theDude

200

6.

redcharcoal

125

7.

roger.berbel

125

8.

Anpanman

87

9.

john2

80

10.

joxley

75

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es