I have an idea for a fancy web app, I made a prototype and since the main algorithm is solving a NP-complete problem, its rather compute intensive. So much so that it wouldn't be worth it if I had to do all the calculating server side, meanwhile, if I ran it on the clients computer, I wouldn't have this problem.
I have no illusions about keeping the algorithm hidden forever, I know that any code running in a computer that isn't under my control can be reverse engineered. I still don't want to make it so easy that anybody could just download the .js file (or whatever) and use it on their own website with no effort though.
What kind of options do I have here? I think javascript is out since.. plain text and all. Flash is trivial to decompile and Java is problematic since many computer users have it disabled or it requires pressing "accept" button somewhere etc.
Without forcing them to use something like java,flash,silver light or python etc etc.
You would be stuck with javascript.
Step one would be to minimize it. That would make it hard for people to reverse engineer.
An idea could be to take key parts of the computation and do it on the server. Using ajax to communicate back and forward with the client. So you could do basic grunt work on the client and then at a point where you want to hide you magic and do ajax wait for the response and keep calculating. This way you could use the client to do say 90% of the computing and then the server does only 10% and no one can completely reverse engineer it.
But to be honest IMO and client side computation is risky due to security issues. But I guess that depends on your particular usecase, I only mention it because your question talks about trying to stop information being stolen.