How can I encrypt JavaScript code so that it's not decryptable?

前端 未结 12 2200
温柔的废话
温柔的废话 2020-12-01 15:07

I have some JavaScript code I need to encrypt, but I want to be sure no one can decrypt it.

What tools can I use to do this?

-- Edit --

12条回答
  •  囚心锁ツ
    2020-12-01 15:46

    This is exactly DRM: you're giving the user a lock, and also the key to it, and expecting to be able to say what they can do with it.

    It's theoretically impossible: if their computer can execute the code, it has to be unencrypted there.

    It's practically impossible, too: look at everybody watching DVDs on Linux boxes to see how successful you can be.

提交回复
热议问题