LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Protecting site content with java script (https://www.linuxquestions.org/questions/programming-9/protecting-site-content-with-java-script-389424/)

Gogul 12-05-2005 08:38 AM

Protecting site content with java script
 
I've got to write a report on protecting a sites content from being copied and I was wondering if anyone knows the code snippet that stops the a user from copying items on a page.

I'm sure I used it once before though I can't remember how it works :o

It was something along the lines of a basic js function though I'm sure there was some kind of command that would go into the body section of a html document to put the function into effect.

If someone can help me out them they would be doing me a big favor! :)

I should prob mention that I'm fairly new to js though you prob would have guessed that lol

320mb 12-05-2005 08:49 AM

http://www.dynamicdrive.com/dynamicindex9/index.html

Gogul 02-07-2006 04:43 AM

I know it was a while back but I forgot to say thanks for the help, so thanks.

Soz it took me so long to respond

Wim Sturkenboom 02-07-2006 04:52 AM

A bit late as well, but you can not really protect the content. When a page is loaded in your browser, (some) stuff resides in temp directories. A slightly experienced user might know where that is and will be able to copy from there.

german 02-14-2006 07:27 AM

anybody can copy the URL from their address bar and use a tool such as wget to obtain the html source. Or you can just hit ctrl-u in mozilla browsers. It is completely infeasible to hide your source code from people using your site (you could, conceivably, create a script which downloads an encrypted version of your content, decrypts it and appends it to the browser DOM).

xhi 02-14-2006 07:56 AM

and what happens when you load said page up with lynx or other js-less browser?

anyhow most of the js protections i have seen only really stop one from right clicking..

Gogul 02-20-2006 04:44 AM

well I know there is no fool proof way to protect a sites content, though the idea is to make it more difficult for the less experianced user. There is one resource on the web that garbles the site code so a person viewing the source code will not be able to make sense of it.

I will get you the url when I can if you're interested.:study:

alienDog 02-20-2006 07:03 AM

Quote:

Originally Posted by Gogul
well I know there is no fool proof way to protect a sites content, though the idea is to make it more difficult for the less experianced user.

... therefore effectively making computers harder to use for the people that are already having difficulties using them, while causing a minor inconvenience for the more exprienced user ;) bad, bad, bad.

Gogul 02-20-2006 10:08 AM

I can see what you mean lol :tisk:

slantoflight 02-21-2006 02:39 PM

Quote:

Originally Posted by german
anybody can copy the URL from their address bar and use a tool such as wget to obtain the html source. Or you can just hit ctrl-u in mozilla browsers. It is completely infeasible to hide your source code from people using your site (you could, conceivably, create a script which downloads an encrypted version of your content, decrypts it and appends it to the browser DOM).

Althought it sounds ridiculous at first, I think he might have actually been on to something here.

Translate an open source encrypting algorithm into its javascript equivalent. Obfuscate the code beforehand to make it even more fun. Put a whole bunch of object dependecies in your page. And ofcourse in a good encryption scheme, the security is also enforced on the server side as well.(can't have the server breaking its own rules can we?) Something like, if such and such txt file is'nt in the directory. And ofcourse the txt file conviently dissappears when your server detects the client disconnect/refresh. And use frequent refreshes too.
With this scheme every connection gets different html code sent to it.

Make it so that even if they get the an HTML file out of the browser temp directory, they'll have a hell of a time trying to use it. Its crazy, but not impossible.

german 02-21-2006 05:07 PM

Quote:

Originally Posted by slantoflight
Althought it sounds ridiculous at first, I think he might have actually been on to something here.

Translate an open source encrypting algorithm into its javascript equivalent. Obfuscate the code beforehand to make it even more fun. Put a whole bunch of object dependecies in your page. And ofcourse in a good encryption scheme, the security is also enforced on the server side as well.(can't have the server breaking its own rules can we?) Something like, if such and such txt file is'nt in the directory. And ofcourse the txt file conviently dissappears when your server detects the client disconnect/refresh. And use frequent refreshes too.
With this scheme every connection gets different html code sent to it.

Make it so that even if they get the an HTML file out of the browser temp directory, they'll have a hell of a time trying to use it. Its crazy, but not impossible.

As soon as I wrote it I set out to find out if anybody had done it, and found, as I had expected to, that it's been done.

http://www.devscripts.com/scripts/50...ML_Encryption/

Gogul 02-24-2006 06:29 AM

that's an interesting idea though I wouldn't really bother with it so much because if people can't view the source code then it just makes it more diffucult for users to work out how to use it and ultimatly learn.

If I've produced a script that's taken time to write then I might be a bit annoyed if someone uses if for commercial purposes, though it they're going to do the amature thing then they will not really get very far...

german 02-24-2006 09:18 AM

Quote:

Originally Posted by Gogul
If I've produced a script that's taken time to write then I might be a bit annoyed if someone uses if for commercial purposes

That's why the GPL was invented. If anybody extends what you've done and licensed as GPL, they must also release it as GPL so you can make your original version better.

Gogul 02-28-2006 10:42 AM

I've heard there's a PHP script that leaves a watermark on an image when you save it.

Does anyone know it?

german 02-28-2006 10:49 AM

Quote:

Originally Posted by Gogul
I've heard there's a PHP script that leaves a watermark on an image when you save it.

Does anyone know it?

google knows just shy of a million ways to do it...

http://www.google.com/search?hl=en&q...e+Search&meta=


All times are GMT -5. The time now is 03:43 AM.