HTML Obfuscation – February 19, 2010
I just finished a fun project today for a customer that involves trying to prevent HTML from being easily copied. It isn't possible to prevent someone like myself from getting the content, but you can go pretty far in preventing an average user from getting the content.
There are a couple commercial solutions available, but they fail in different ways, mostly notably not working in some browsers (I still need to test mine with Safari and Opera), but even in Internet Explorer, all of the solutions I saw let you "save as text" and you get the entire text content of the page. My customer is particularly interested in protecting the text content, so those options weren't acceptable.
You can see an example of the protected HTML: protected.txt.
The other neat thing about this project is that the HTML is dynamically generated from source .js and .html files, and I am planning on using a tinymce editor for the customer, so I'll need to update the script to parse the generated HTML from the editor in order to obfuscate it.