Question on HTML

I’ve already searched the net for this and I couldn’t find anything. So either it doesn’t exist or I am not searching for the right thing.

My Question is this, Is there any code for html that will make it so that someone viewing your page is unable to view your source code, and therefore unable to copy it from you?

Afraid to tell you that it can’t be done. There are things you can do that make it more difficult ie lots of blank lines at the beginning (can trick those who dont know better into thinking there is nothing there), java codes that trap right clicking, etc…But they are not really effective. Sorry to say that the source is how the browsers read the HTML in the first place, so it cant be encrypted.

Not HTML, but there’s a scripting function, unknown to me, that disables the View/Source functions of browsers. I don’t what it is offhand, but I’ve run into quite a few pages that use it.

Plus, you also have to prevent the “save as” operation allowing them to just deposit the source as a file on their local disk, and you certainly couldn’t prevent somebody from just using a simple file download utility to obtain your source. If a suitable one isn’t around, writing a short program to take a URL on the command line, simply request it and deposit the results to a disk file is very little work, particularly in Java which has standard lib support for it already. As observed, the problem is that the source is interpreted on the client side.

Reminds me of the old days when there actually used to be “cloaker” programs for C source code. I had a boss once who had worked for a graphics driver company. They were faced with the problem of having to deliver their actual source to be compiled on the customer’s site, and they didn’t want to divulge all the lovely work they’d done to optimize for various graphics devices. They’d had a homegrown cloaker, but there were commercial ones available.

After running though a cloaker, the C code was very hard for a human to understand, though it still worked. You did things like change all the identifiers into random strings, completely destroyed the formatting, and so on. If you really got fiendish, you “unwound” all the block structured statements and rearranged each routine into a randomly juggled sequence of program blocks with goto’s. You could also indulge in various stunts to make string literals hard to understand or relate to the code using them.

For HTML layout, you’re limited as to what a cloaker could do, but I strongly suspect that if you are that worried about your intellectual property, it’s javascript you’re really trying to protect.

A brief poke for “cloaker” or “obfuscator” in google reveals that the idea is alive and well:

http://rzr.online.fr/docs/shop/jammer.htm
http://www.quietfire.com/jscloak/

I’m sure you can find more of them.

Here’s a site that will encrypt your html:
http://www.cyberarmy.com/encrypt.shtml

try using .asp instead of .html, if possible ( i’m using “if possible” 'coz i’d expect to be swamped by “but he’s asking .html not .asp” )…that way your source code can remain in the .asp file and the output file in the viewers browser will not contain any of the code…effectively shielding it from any and all viewers… i know this answer is vague, though correct, but that’s 'coz i’m assuming you have basic knowledge of how .asp works.

also, i second what AWB says.