开发者

How to encrypt HTML, CSS and JavaScript to prevent copyright infringement [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

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

I am looking into ways to 'encrypt' 开发者_如何学编程my HTML and CSS code so that a visitor cannot simply 'View Source' and copy it.


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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜