So, normally, obfuscators will minify the code and perhaps make things more obscure. As is already well established on the internet, you cannot prevent viewable source code (i.e. JavaScript in the browser), or even any code executed on a client computer at all, from being hacked. Not only that, but there are deobfuscators and code inferencers (e.g. JSNice) out there that make viewing and understanding the source code extraordinarily easy.
What if your goal, however, would just be to make it extremely difficult to tamper with the code, or perhaps even to steal the code and put it on another website? The goal would be to deter people enough that they would rather rewrite the code from scratch than steal or tamper with your existing work.
What methods might one employ to accomplish this effectively? (I'm also interested in any well-defined concepts in this area.) Rules are:
- Can't significantly bog down the client-side code, to the point that it's laggy on slower computers.
- Utilizing server code in any way is allowed, e.g. sending different arrangements of the code to the client, sending hash strings, etc. (This does not include replacing the client altogether, of course; there will be live user interaction and such.)
- Regular load times of a few seconds or less is acceptable.
- Browser JavaScript is the preferred answer language/environment, but other ideas such as hosting JavaScript in a client application or using a standard client are also welcome.