Is using an obfuscator enough to secure my JavaScript code?

后端 未结 9 2220
无人共我
无人共我 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 02:08

    You are going to be fighting a losing battle if you try to obfuscate your code in the hopes of someone not stealing it. You may stop the casual browser from getting at it, but someone dedicated would almost certainly be able to overcome any measure you use.

    In the past I have seen people do several things:

    1. Paste a lot of whitespace at the top of the page with a message telling people that the code is unavailable, when in actuality you just need to scroll down a few pages to get at it.
    2. Running it through an encoder of some kind, this is so so useful as it can just be run through the decoder.
    3. Another method is to reduce variable names to one character and remove whitespace (this is also an efficiency thing).

    There are many other methods.

    In the end, your efforts are only likely to stop the casual browser from seeing your stuff. If someone dedicated comes along then there is not much you will be able to do. You will have to live with this.

    My advice would be to make a really awesome product that attracts the most people and beat off any competition by having the best product/service/community and not the most obfuscated code.

提交回复
热议问题