[nycphp-talk] Making text hard to copy
blakeelias at gmail.com
Sat Aug 7 00:01:21 EDT 2010
One site that I worked on had an image for each character on some
pages -- in the images directory, each file X.gif was an image
representation of character X, and the pages would call for a bunch of
those images to spell out words. I think it was more so they could
get a particular font than for any duplication concerns, but that
could be a pain to copy. It did impact performance and search engine
optimization, so I ended up converting it to text by replacing each
<img> tag with its respective character. It wasn't that hard for me,
but would require a user who wants to duplicate it to know how to view
source, and then to have some knowledge of find/replace or regular
You could make it even harder by naming the file something different
than the character represents, without an obvious formula. Make a key
of characters -> filenames that only you have, and have a script
(possibly PHP) convert your text into a series of images following
that key. A user would have to read through the source code, match up
each filename to the character on the page, and run a bunch of
find/replace commands to get the original text.
If all that's still too easy to copy, insert some extraneous
dynamically remove them from the page. Now someone using view >
source would have a real tough time matching it all up and removing
the extraneous characters, unless they are using a DOM inspector tool
like Firebug that shows DOM changes as they are executed.
At this point it would be faster for them to just retype the whole
page, which they can do no matter what.
Basically, it all depends how much you care about accessibility to a
variety of users, speed/performance, and search engine optimization.
Images and Flash will make it inaccessible to some users and make it a
bit slower. That may be a price you and the customer are willing to
pay. It will also make it hard/impossible for search engines to
On Fri, Aug 6, 2010 at 9:50 PM, Anthony Papillion <papillion at gmail.com> wrote:
> I'm starting to work on a system that will require a bit of extra security.
> One of the security protocols the customer's decided on is that the
> outputted page should be fairly hard to copy. Yes, I know making an HTML
> page uncopyable is impossible but I want to make it as hard as possible.
> So far, I've come up with the following possible solutions:
> - Put all the output on an image and disable right click
> - Output a PDF
> Both of these solutions really feel nasty to me and don't really solve the
> problem at all. Does anyone have any other ideas?
> Anthony Papillion
> Lead Developer / Owner
> Advanced Data Concepts - "Enabling work anywhere"
> (918) 533-9969
> Facebook: http://www.facebook.com/cajuntechie
> My Blog: http://www.cajuntechie.com
> New York PHP Users Group Community Talk Mailing List
More information about the talk