-
克隆 gc git@github.com:iWinston/javascript-code-protection-example.git
https://zhuanlan.zhihu.com/p/84386456
提供一个JavaScript obfuscator + bytenode + node-packer的解决方案。
极简的Node.js字节码编译器 https://github.com/OsamaAbbas/bytenode
通过npm安装javascript-obfuscator 和 bytenode。然后在当前系统下安装 node-packer
打包成一个执行文件 安装 nodec ,有点复杂 https://github.com/pmq20/node-packer 下载 nodec-v1.5.0-linux-x64.gz
javascript-obfuscator支持多种混淆技术,可能通过查看文档,按照自己的项目需求,调配选用合适的选项。
An example of JavaScript code protection.
This repository contains an example of JavaScript code protection using javascript-obfuscator, bytenode and node-packer.
- Clone this repo and change directory to it.
- Install the dependencies using
npm install
. - Make sure you have installed node-packer: https://github.com/pmq20/node-packer OR https://github.com/slee047/node-packer (For releases after Node.js 8.3.0)
npm run obfuscate
: obfuscate theindex.js
toindex-obfuscated.js
npm run bytenode
: compile theindex-obfuscated.js
toindex-obfuscated.jsc
npm run bytenode:run
: run theindex-obfuscated.jsc
npm run nodec
: package your Node.js projectnpm run build
: package your Node.js project into an executable that is obfuscated and compiled