Is using an obfuscator enough to secure my JavaScript code?

后端 未结 9 2218
无人共我
无人共我 2020-12-13 01:04

I\'m working on building a development tool that is written in JavaScript.

This will not be an open source project and will be sold (hopefully) as a commercial produ

9条回答
  •  独厮守ぢ
    2020-12-13 01:55

    A obfuscator won't help you at all if someone wants to figure out the code. The code still exists on the client machine and they can grab a copy of it and study it at their leisure.

    There is simply no way to hide code written in Javascript since the source code has to be handed to the browser for execution.

    If you want to hide your code, you have the following options:

    1) Use an environment where compiled code (not source) is downloaded to the client, e.g. Flash or Silverlight. I'm not even sure that's foolproof, but it's certainly much better than Javascript.

    2) Have a back end on the server side that does the work and a thin client that just makes requests to the server.

提交回复
热议问题