views:

295

answers:

6

Possible Duplicate:
What are some good ways to prevent people from copying my source code?

Hi,

I am looking into ways to 'encrypt' my HTML and CSS code so that a visitor cannot simply 'View Source' and plagiarize it.

Thanks.

+8  A: 

That's not possible; you should copyright your code instead if you are worried.

Or you may want to have a look at:

Obfuscated Code

Sarfraz
Pointy
The bad news is that you can't afford to enforce your copyright.
Jamie Ide
A: 

That's the beauty of HTML, CSS and JavaScript - you can't. You can make it harder using a framework (Drupal and WP in PHP) along with ASP.NET. But plain old HTML > CSS > JavaScript - you simply can't.

Why do you think you need to protect your code? Isn't Open Source and Communities (like StackOverflow) the best source of accurate information? Get out there, publish yourself and get a reputation. Still, if you built it first, you can prove to everyone you can make astonishing design and beautiful websites.

BennySkogberg
+4  A: 

There aren't any. The best you could do is some tool that will minify or obfuscate your javascript code. However, there's no way to make it truly secure. Encryption implies decryption on the client side, which exposes everything to the user.

Eric Mickelsen
A: 

There are packages you can buy that "promise" protection, but I agree with tekMick, minify or obfuscate.

gnome
+1  A: 

So why is this not possible? HTML, CSS, and Javascript are all client-based. Meaning that you have to give the user your code, and it is processed on his machine. You can't simultaneously show someone the code and prevent him from seeing it.
Depending on exactly what it is you want to protect, you may want to look into server-based technologies like PHP or ASP.

You also of course have the option of just doing a really good job to build the reputation of you/your company. After all, imitation is the sincerest form of flattery. Or doing a really crappy job so that nobody wants to copy you.

Larry Wang
A: 

Hi ..

Apply javascript and mouse right click disable..

Look this link...http://www.dynamicdrive.com/dynamicindex9/noright.htm

THanks ptiwari.

Prashant
No! Firstly, it annoys users by disabling the entire right-click menu. Secondly, view source is available in other browser menus, via hotkeys, and so on. Finally, if I *really* want to see your source or save your images I can use a free developer tool like Firebug, or simply disable javascript!
Olly Hodgson