Having written a commercial obfuscator, I can assure you that there actually is no way. Encrypting or obfuscating your client code won't prevent it from being stolen, analyzed or even "reused" by other people. Just live with the fact that if your software gets popular enough, your client code will be copied or modified.
The only way to secure your product is to make the client depend on algorithms running on your server. That's also the reason why most popular computer games are becoming "online only" recently.
The only way to secure your product is to make the client depend on algorithms running on your server. That's also the reason why most popular computer games are becoming "online only" recently.