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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
12-05-2005, 08:38 AM
|
#1
|
Member
Registered: Nov 2005
Posts: 112
Rep:
|
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 08:39 AM.
|
|
|
12-05-2005, 08:49 AM
|
#2
|
Senior Member
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577
Rep:
|
|
|
|
02-07-2006, 04:43 AM
|
#3
|
Member
Registered: Nov 2005
Posts: 112
Original Poster
Rep:
|
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
|
|
|
02-07-2006, 04:52 AM
|
#4
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
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.
|
|
|
02-14-2006, 07:27 AM
|
#5
|
Member
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312
Rep:
|
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).
|
|
|
02-14-2006, 07:56 AM
|
#6
|
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065
Rep:
|
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..
|
|
|
02-20-2006, 04:44 AM
|
#7
|
Member
Registered: Nov 2005
Posts: 112
Original Poster
Rep:
|
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. 
|
|
|
02-20-2006, 07:03 AM
|
#8
|
Member
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505
Rep:
|
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.
|
|
|
02-20-2006, 10:08 AM
|
#9
|
Member
Registered: Nov 2005
Posts: 112
Original Poster
Rep:
|
I can see what you mean lol 
|
|
|
02-21-2006, 02:39 PM
|
#10
|
Member
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Rep:
|
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.
|
|
|
02-21-2006, 05:07 PM
|
#11
|
Member
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312
Rep:
|
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/
|
|
|
02-24-2006, 06:29 AM
|
#12
|
Member
Registered: Nov 2005
Posts: 112
Original Poster
Rep:
|
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...
|
|
|
02-24-2006, 09:18 AM
|
#13
|
Member
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312
Rep:
|
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.
|
|
|
02-28-2006, 10:42 AM
|
#14
|
Member
Registered: Nov 2005
Posts: 112
Original Poster
Rep:
|
I've heard there's a PHP script that leaves a watermark on an image when you save it.
Does anyone know it?
|
|
|
02-28-2006, 10:49 AM
|
#15
|
Member
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312
Rep:
|
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:46 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|