Socket
Socket
Sign inDemoInstall

mangle-js-webpack-plugin

Package Overview
Dependencies
92
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mangle-js-webpack-plugin

支持3种加密算法: `aaencode` `jjencode` `obfuscator JS`(默认)


Version published
Weekly downloads
9
decreased by-30.77%
Maintainers
1
Install size
27.9 MB
Created
Weekly downloads
 

Readme

Source

加密混淆js

支持3种加密算法: aaencode jjencode obfuscator JS(默认)

aaencode

优点:安全 缺点:加密体积大,会导致浏览器内存溢出。安卓手机尤其解析困难

适合做核心代码加密

゚ω゚ノ= /`m´)ノ ~┻━┻ //*´∇`*/ ['_']; o=(゚ー゚) =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: '_' ,゚ω゚ノ : ((゚ω゚ノ==3) +'_') [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ '_') // ...

jjencode

优缺点基本同aaencode

sojson=~[];sojson={___:++sojson,$$$$:(![]+"")[sojson],__$:++sojson,$_$_:(![]+"")[sojson],_$_:++sojson,$_$$:({}+"")[sojson],$$_$:(sojson[sojson]+"")[sojson] // ...

obfuscator JS 加密

优点:轻量,数组编码+ASCII16进制。运行速度快,不可逆。

基本能对完整代码使用

本插件中依赖了javascript-obfuscator 作为默认加密方式

var _0x9272=["\x69\x6E\x66\x6F","\x61\x64\x69\x6E\x66\x6F","\u7AD9\u957F\u63A5\u624B\u52A8\u52A0\u5BC6\uFF0C\u4FDD\u536B\u4F60\u7684\x20\x6A\x73\u3002"];(function(_0x2841x1,_0x2841x2){_0x2841x1[_0x9272[0]]= _0x9272[1];})(window, document);

usage

plugins: [new MangleJsClassPlugin()]
plugins: [new MangleJsClassPlugin({
  exclude: /(manifest.*js.*$)|(bundle.*js.*$)/,
  //include: /test\.js.*$/,
  algorithm: 'obfuscator', // 'obfuscator(default)' || 'jjencode' || 'aaencode'
  algorithmConfig: {
    prefix: 'focus' // config of jjencode
    log: false // config of obfuscator 具体配置参考https://github.com/javascript-obfuscator/javascript-obfuscator
  }
})]

建议:用在UglifyJsPlugin之后,排除vendor文件加密

Keywords

FAQs

Last updated on 29 Oct 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc