Coder Social home page Coder Social logo

mangle-js-webpack-plugin's Introduction

加密混淆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文件加密

mangle-js-webpack-plugin's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.