LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-05-2005, 09:38 AM   #1
Gogul
Member
 
Registered: Nov 2005
Posts: 112

Rep: Reputation: 15
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

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

Last edited by Gogul; 12-05-2005 at 09:39 AM.
 
Old 12-05-2005, 09:49 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 47
http://www.dynamicdrive.com/dynamicindex9/index.html
 
Old 02-07-2006, 05:43 AM   #3
Gogul
Member
 
Registered: Nov 2005
Posts: 112

Original Poster
Rep: Reputation: 15
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
 
Old 02-07-2006, 05:52 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
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.
 
Old 02-14-2006, 08:27 AM   #5
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
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).
 
Old 02-14-2006, 08:56 AM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
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..
 
Old 02-20-2006, 05:44 AM   #7
Gogul
Member
 
Registered: Nov 2005
Posts: 112

Original Poster
Rep: Reputation: 15
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.
 
Old 02-20-2006, 08:03 AM   #8
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
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.
 
Old 02-20-2006, 11:08 AM   #9
Gogul
Member
 
Registered: Nov 2005
Posts: 112

Original Poster
Rep: Reputation: 15
I can see what you mean lol
 
Old 02-21-2006, 03:39 PM   #10
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
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.
 
Old 02-21-2006, 06:07 PM   #11
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
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/
 
Old 02-24-2006, 07:29 AM   #12
Gogul
Member
 
Registered: Nov 2005
Posts: 112

Original Poster
Rep: Reputation: 15
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...
 
Old 02-24-2006, 10:18 AM   #13
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
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.
 
Old 02-28-2006, 11:42 AM   #14
Gogul
Member
 
Registered: Nov 2005
Posts: 112

Original Poster
Rep: Reputation: 15
I've heard there's a PHP script that leaves a watermark on an image when you save it.

Does anyone know it?
 
Old 02-28-2006, 11:49 AM   #15
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
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=
 
  


Reply

Tags
programming, web


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just created a Debian web portal site and it need some good content. ExCIA General 15 06-05-2007 04:15 AM
Shell script: substitute a file's content according to a map? Chowroc Programming 11 11-15-2005 05:08 AM
use file content as tcl script parameters powah Linux - General 3 07-16-2005 12:10 PM
New Site content help English Fedora 1 06-29-2004 07:43 PM
GFTP won't let me see the content of my site! el_felipe Linux - Newbie 1 02-01-2002 01:06 AM


All times are GMT -5. The time now is 04:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration