How to keep my source code safe?

My complete requirements:
I want to create a product for a company. I want to make sure that my source code won't leak out. And, I want to bind a license to a computer's hardware, make sure my software won't run without a license.
How to implement that?
Thanks very much.


  • This is a complex question. I don't know how you're planning to distribute your app but almost always you will have a hard time completely obfuscating your source. There are tools out there (search for JavaScript obfuscator) that might help. Try searching for answers on StackOverflow, too.
  • (editorial warning - the following is my opinion and does not reflect that of my employer, colleagues, or possibly anyone else)

    You'll find it very difficult to adequately 'secure' a javascript application. An obfuscator, as Roy suggested, is a deterrent but a meager one. Any code that is sufficiently important, unique, or complex to justify obfuscation is also probably sufficiently important, unique, or complex for someone to de-obfuscate rather than rewrite.

    Ultimately, the value a particular application provides is not the application itself but in the idea, the people behind the idea, and the innovation they bring to its execution. If you create a particularly elegant application, it will be copied -- perhaps not by lifting your code but copied nonetheless. I'd choose to spend my time innovating on the idea rather than fretting about someone copying me. As long as they're copying rather than innovating, you're in the lead which is a great place to be.

    The one caveat here would be if the algorithm you've implemented for something is truly the intellectual property. If that's the case, you don't want to implement that in JS deployed to untrusted machines. Keep that server-side on trusted servers.
Sign In or Register to comment.