How can I prevent users from copying text from my website?

In summary: Nope, no way to make your website content completely safe. If someone wants to store it or copy it there is no sure protection. Sorry :frown:Well, you could potentially use a Java applet to display the secure content.
  • #1
ahrkron
Staff Emeritus
Science Advisor
Gold Member
760
2
Say you have a website with mainly text, but that you want people not to be able to just "copy-paste" from it.

Is there a way to make the browser:
1. Download the content as text (so that the speed stays ok),
2. Display it normally, but
3. Block any user from selecting a portion of it (so that he cannot copy it into another application)
?
 
Computer science news on Phys.org
  • #2
ahrkron said:
Say you have a website with mainly text, but that you want people not to be able to just "copy-paste" from it.

Is there a way to make the browser:
1. Download the content as text (so that the speed stays ok),
2. Display it normally, but
3. Block any user from selecting a portion of it (so that he cannot copy it into another application)
?

Nope, no way to make your website content completely safe. If someone wants to store it or copy it there is no sure protection. Sorry :frown:
 
  • #3
Well, you could potentially use a Java applet to display the secure content. You could make it pretty damn difficult to copy and paste it that way.

Of course, in the end, it's all just bytes over a network connection, and anyone with enough sense can look at those bytes. Using some kind of cryptosystem will make the content difficult to copy -- but never, never impossible.

- Warren
 
  • #4
Thanks guys,

Actually, I don't need all the way to "impossible". "Kind of hard" would be good enough. Some friends of mine are putting together a site for homework help in Spanish, and they want the kids to be forced to at least type the answers once (or look it up by themselves, which would be equivalent to doing the homework). What can be done for this? Any web references, or code snippet that could be used?
 
  • #5
Could you make the pages be .pdf's, or does the size become to large to handle then?
 
  • #6
They started making png's out of the text (with "watermarks" behind the text), but it doesn't quite cut it.
 
  • #7
Is there a way to make the browser:
1. Download the content as text (so that the speed stays ok),
2. Display it normally, but
3. Block any user from selecting a portion of it (so that he cannot copy it into another application)


This code disables all clicks from the user of your site:

<script language="javascript">

// No click script


function click() {

if (event.button==1 || event.button==2) {

alert('Sorry, that function is disabled')

}

}

document.onmousedown=click

</script>
 
  • #8
Except for those of us who know how to turn off javascript.

Oh wait, that's too easy, let's take a screen shot instead. If you can't handle giving out images, odds are you can't handle distributing the material in any format.
 
  • #9
It is not an "on-off" thing. The smaller the download size, the better.
 
  • #10
Except for those of us who know how to turn off javascript.

Can you suggest a better solution?

ahrkron, maybe you can do something to your site in which you have to have javascript enabled to make it work.

Disabling all clicks stops them from right-clicking/copying, or being able to highlight and select text completely.

It's your best bet while displaying the site normally you can block most users from displaying the text.
 
  • #11
Listen guys, forget the browser. You can spend all your time trying to make people's browsers not allow things, but who cares? Anyone with half a brain will type:

telnet server.com 80
GET /page.html HTTP/1.0

and be done with it. No browser needs to be involved. Or the user can use his browser's view source feature. Or he can use a packet sniffer to dump all the IP traffic, and read the bytes from that.

Bottom line, if the bytes go across the network unencrypted, they can be captured by anyone with more than a dozen neurons.

You could use https to prevent people from capturing packets off the network, but then you have to deal with the security limitations of the browser. Hence, you make a Java applet, or a custom program, that does its own decryption.

It still doesn't prevent the user from taking a screen shot of it.

- Warren
 
  • #12
Even if there were a way to copy-protect the text, It still would be pretty easy to copy it: Just take the page and hit Print Screen on the keyboard and paste it onto Paint and save it as an image.
 
  • #13
Even if there were a way to copy-protect the text, It still would be pretty easy to copy it: Just take the page and hit Print Screen on the keyboard and paste it onto Paint and save it as an image.

Chroot and NateTG have already mentioned the "screen shot" problem before, no need to mention it for a 3rd time.

Would you rather them be able to freely copy and paste?

His problem was that he didn't want users selecting portions of text on his website - so the most logical thing to do is disable clicks.
 
  • #14
Hide text that is the same color as the background and use that as spaces. For instance if I was going to do this, I'd say:

The<FONT COLOR ="white">X<\FONT>answer<FONT COLOR ="white">X<\FONT>to<FONT COLOR ="white">X<\FONT>the<FONT COLOR ="white">X<\FONT>question.

here's what the above would look like when rendered by Safari (to heck with MS). Cut and paste to see what I you get.

The xanswerxtoxthexquestion.

There is a slightly larger gap between 'The' and 'answer' because I squeezed two characters in ther. You can fiddle with the font size of the two characters to make them look like one character.

In the above, the 'X' would not show if the background color was white, but it would show if the student simply cut and pasted. You can hide a few marks like this to indicate if the cut and paste was used. Purposly miss spell selected word using the hidden words as indicators. I wouldn't recomment filling every blank as I did, but one or two blanks would be enough to show if the cuts and pasts are going on. If you do the above, use courier font if you can because each character, including spaces, occupies the same width. Also, you can set the font size between one of the gaps to 6 which would allow you to put a space and a character in the same space as a font size 12 would occupy. People usually miss the single characters mistakes.

Hopeful I explained this well enough. I'm a little tired thus my ability to express myself is less than optimal.

You won't stop cutting and pasting but you'll be able to catch them in the act. Warn the kids the first day of class. Bring their names up the first time they get caught doing it to the entire class. "Johnny, you might try typing in the assignment as I said not cutting and pasting." This let's them know you can catch them. yadda-yadda-yadda...

As far as disabeling clicks, you can do it pretty easily, but you can get around that just as easily.


EDIT: Argh! fixed my AFU HTML example.
 
Last edited:
  • #15
chroot said:
Listen guys, forget the browser. You can spend all your time trying to make people's browsers not allow things ... Anyone with half a brain...
Think of the context. I agree that some kids will still be able to get around any protection, but the site is for help for kids from 6 yo on; for sure, most of them won't be able to do a telnet + get.

motai said:
... hit Print Screen ...
They thought about this. Can be easily solved with a graphic background with a logo and saying "Taken from such website". This of course can also be overcome, but again, most kids won't know about graphic filtering, color histogram editing, etc.

Also, the tips and answers provided are often short enough to make it easier to retype than to "process".

faust9:

Good idea! Thanks.


Anyway, does anybody know any other ways to make text-copying even slightly difficult?, besides the ones already mentioned?

Thank you all.
 
Last edited:
  • #16
I think the best way is to have a picture with some type of background, preferable alternating light gray and dark gray dashed grids across the picture. This way if you do a print screen and run the image through OCR the program will have trouble converting the picture into plain text. You also want to bleed the grids into the text in a way so it is readable, but you can't just take the picture into photoshop and use the magic wand to select the grid and delete it.
 
  • #17
I think faust9 is on the right track ... rather than try to prevent it, set it up so catching it is easy. Your purpose is probably more to do with encouraging 'proper' behaviour and good learning styles than setting technical hurdles (whose defeat may be an irresistable challenge to some).

As always in teaching, knowing your students well is best for your own pedagogical objectives (and, hopefully, their educational experience :wink: ), so it's better that you know what's going on (and they don't). One problem I've seen is the 'help' which some students get, from siblings, friends, parents ... (may not be relevant at all for you).

In addition to faust9's double spaces, you could add unicode characters which look all the world like English letters but aren't, an occassional (double) quote mark for an apostrope, ...
 
  • #18
Also, to add onto my idea, you could write a program that would allow the teacher to enter the sentence he/she wants and the script would then automatically generate HTML code with random letters shoved into the spaces. The HTML program would be pretty easy to write thus making the whole process much easier. If you can run a PHP server life could be made even easier. You, or someone, could develop a PHP script to parse sentences for spaces and then insert random characters each time the particular sentence is downloaded. PHP is server side so you can set up a simple txt format data base of sentences and the PHP will do the rest. By inserting random characters each time the sentence is loaded to the browser you make it tougher for one student to tell another student which characters to remove. Also by inserting random characters into every space you will end up forcing the student to read the sentence and analize each word to find the offending characters anyway. The system is easy to figure out but hard to get around because the work is being done on the server rather than the student's computer. Cutting and pasting would be easy but removing the offending characters would be cumbersom. I wouldn't use numbers as the random characters because numbers would stick out while lower case letters would probably blend in fairly well.

One way to crack this would be to use a script to parse the HTML code for the <FONT COLOR="white">_someCharacterHere<\FONT> and simply replace this with a space. Students with a fair amount of programming experience could do this, but I dare say few would.

I think you know there are no ways to truly stop students from getting around this, or any system, but there are ways to discourage this. If the process is easily figured out but more burdensome to circumvent than simply doing what is required then most will end up doing what is required.
 
  • #19
so why are you trying to destroy the internet anyway? if somethings so sensative that it can't be copied (and what's to stop someone from just screencapping, or writing it down by hand) then why are you dissamenating that information?
 
  • #20
ahrkron said:
Thanks guys,

Actually, I don't need all the way to "impossible". "Kind of hard" would be good enough. Some friends of mine are putting together a site for homework help in Spanish, and they want the kids to be forced to at least type the answers once (or look it up by themselves, which would be equivalent to doing the homework). What can be done for this? Any web references, or code snippet that could be used?

I don't think what is being proposed is as dire as destroying the internet. I think ahrkron simply wants kids to work a little at learning Spanish while using the net as a tool to do so.
 
  • #21
kronchev said:
so why are you trying to destroy the internet anyway?

OMG! How did you figure it out!? :smile:
 
  • #22
This will make it so that they can't select the text:
Code:
<textarea disabled>Your text here</textarea>
Now if you wanted it to look just like normal text you would have some css on it like so:
Code:
<textarea style="border-style:none;resize:none;color:black;width:100%;height:100%;background-color:white;" disabled>Your Text Here</textarea>
 

What is "block text from being copied"?

"Block text from being copied" refers to a security measure that prevents users from copying or pasting text from a document or webpage. This is often used to protect sensitive or copyrighted information.

How does blocking text from being copied work?

This feature is typically implemented through the use of JavaScript or CSS code. When a user attempts to copy text, the code intercepts the action and prevents it from being executed.

Why would someone want to block text from being copied?

There are several reasons why someone may want to block text from being copied. This could include protecting sensitive information, preventing plagiarism, or safeguarding copyrighted material.

Is it possible to bypass text blocking?

While it is not foolproof, there are ways to bypass text blocking. These include disabling JavaScript or CSS in the browser, using browser extensions or plugins, or taking a screenshot of the text.

Are there any downsides to using text blocking?

Yes, there are some potential downsides to using text blocking. It can make it difficult for users to copy and paste information for legitimate purposes, such as citing sources or sharing information. It can also be frustrating for users if they are unable to copy and paste text that they need.

Similar threads

Replies
14
Views
2K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • Computing and Technology
Replies
5
Views
1K
  • Programming and Computer Science
Replies
7
Views
2K
  • Computing and Technology
Replies
1
Views
1K
  • Feedback and Announcements
Replies
1
Views
371
Replies
1
Views
1K
Replies
90
Views
5K
Replies
2
Views
1K
Back
Top