转自:https://www.againfly.com/flytag_605.html
参考:https://blog.csdn.net/foupwang/article/details/103306332

官网:
https://www.npmjs.com/package/javascript-obfuscator

民间安装方式

npm init -f
npm install formidable --save
npm install -g javascript-obfuscator

官网安装方式

npm install --save-dev javascript-obfuscator

默认不用参数的加密直接执行也可以

javascript-obfuscator input.js --output output.js

使用部分自定义参数

--target 'browser-no-eval'
--disable-console-output true
--debug-protection true
--debug-protection-interval true
--identifier-names-generator 'hexadecimal'
--string-array true
--rotate-string-array true
--string-array-encoding 'rc4'
--string-array-threshold 0.8

更多的详细配置参数可以看官网

javascript-obfuscator 1.js --output 2.js --compact true --target 'browser-no-eval' --disable-console-output true --debug-protection true --debug-protection-interval true --identifier-names-generator 'hexadecimal' --string-array true --rotate-string-array true --string-array-encoding 'rc4' --string-array-threshold 0.8

官方推荐的三种配置

1.性能将比没有混淆的情况下慢50-100%

{compact: true,controlFlowFlattening: true,controlFlowFlatteningThreshold: 1,deadCodeInjection: true,deadCodeInjectionThreshold: 1,debugProtection: true,debugProtectionInterval: true,disableConsoleOutput: true,identifierNamesGenerator: 'hexadecimal',log: false,renameGlobals: false,rotateStringArray: true,selfDefending: true,stringArray: true,stringArrayEncoding: 'rc4',stringArrayThreshold: 1,transformObjectKeys: true,unicodeEscapeSequence: false
}

2.性能将比没有混淆的情况下降低30-35%

{compact: true,controlFlowFlattening: true,controlFlowFlatteningThreshold: 0.75,deadCodeInjection: true,deadCodeInjectionThreshold: 0.4,debugProtection: false,debugProtectionInterval: false,disableConsoleOutput: true,identifierNamesGenerator: 'hexadecimal',log: false,renameGlobals: false,rotateStringArray: true,selfDefending: true,stringArray: true,stringArrayEncoding: 'base64',stringArrayThreshold: 0.75,transformObjectKeys: true,unicodeEscapeSequence: false
}

3.性能会比没有混淆的情况稍微慢一些

{compact: true,controlFlowFlattening: false,deadCodeInjection: false,debugProtection: false,debugProtectionInterval: false,disableConsoleOutput: true,identifierNamesGenerator: 'hexadecimal',log: false,renameGlobals: false,rotateStringArray: true,selfDefending: true,stringArray: true,stringArrayEncoding: false,stringArrayThreshold: 0.75,unicodeEscapeSequence: false
}

javascript-obfuscator 代码混淆相关推荐

  1. 混淆工具JavaScript obfuscator中文帮助文档

    JavaScript obfuscator JavaScript Obfuscator是一个免费并且功能强大的JavaScript混淆器,其中包含多种功能,可为您的源代码提供保护. 主要特征 变量重命 ...

  2. 几维安全Javascript代码混淆(js加密)在线使用说明

    2019独角兽企业重金招聘Python工程师标准>>> 几维安全Javascript代码混淆是一项在线加密服务,用户只需将JS文件打包成zip包,提交到加密平台,即可完成代码混淆.字 ...

  3. 前端JavaScript代码混淆加密原理介绍

    因为JavaScript大都是运行在浏览器端,这就导致任何人都可以直接对网站的代码进行查看,如果代码没有进行任何处理就会导致直接暴露源码,他人便可轻而易举的复制你的劳动成果,但是由于没有纯粹的加密方案 ...

  4. android混淆教程,Android 实现代码混淆的实例

    Android 实现代码混淆的实例 1.简介 代码混淆(Obfuscated code)亦称花指令,是将计算机程序的代码,转换成一种功能上等价,但是难于阅读和理解的形式的行为. 混淆的目的是为了加大反 ...

  5. Android代码混淆配置说明

    1.为什么需要代码混淆 Proguard混淆用于保护APP不被破解和逆向分析,Proguard通过移除没有用到的代码以及通过特定规则重命名类.变量.方法来压缩.优化.混淆你的代码.这样可以让你APK更 ...

  6. 5个常用Java代码混淆器 助你保护你的代码

    [IT168 技术文档] 从事Java编程的人都知道,可以通过逆向工程反编译得到Java程序的源代码,这种反编译工具之一就是JAD.因此,为保护我们的劳动成果,尽可能给反编译人员制造障碍,我们可以使用 ...

  7. 被黑客们使用的代码混淆技术

    长久以来,代码混淆技术一直都被认为是不能登大雅之堂的奇巧淫技,没有哪个学者会拿正眼瞧它一眼.国际C语言混乱代码大赛(International Obfuscated C Code Contest,IO ...

  8. 在Android Studio中进行代码混淆

    此文章来源于http://blog.csdn.net/wenwen091100304/article/details/52802247点击打开链接 在Android APP开发完成后,为了防止APP被 ...

  9. Android Studio 代码混淆(你真的会混淆吗)

    一.前言 今天要打包新产品,突然忘了混淆的参数是怎么写的了,虽然之前也混淆过,可是具体配置的参数代码有些记不起来了,因此决定花点时间写篇博客记录一下,方便以后查找和自己的记忆. 二.Android S ...

  10. Python 代码混淆和加密技术

    动机 Python进行商业开发时, 需要有一定的安全意识, 为了不被轻易的逆向. 混淆和加密就有所必要了. 混淆 为了增加代码阅读的难度, 源代码的混淆非常必要, 一个在线的Python代码混淆网站. ...

最新文章

  1. 这样的独处,能让你变得越来越优秀
  2. vs2015开发c语言 简书,微软符号服务器_NT_SYMBOL_PATH给VS调试带来的隐藏坑
  3. java中的IO详解(上)
  4. 如何在 SAP BTP ABAP 编程环境里直接调用 ABAP On-Premises 系统的 RFC 函数
  5. 3dobject用什么打开_第一次用开塞露是什么感觉?网友:像打开了新世界的大门
  6. struts-tiles学习笔记
  7. 信息学奥赛一本通(1246:膨胀的木棍)
  8. SSM框架笔记15:SSM框架西蒙购物网(XML配置方式)
  9. 2019 十大国产开源项目来势汹汹!
  10. 重装xp后恢复wubi安装的ubuntu
  11. 模因(meme)收集
  12. 电脑总是弹出广告怎么办?
  13. 小米小爱蓝牙音箱_至今为止功能最全面的「小爱同学」!小米小爱音箱Pro体验...
  14. SOLIDWORKS批量转化PDF图纸的方法
  15. 微信问卷调查html,最详细测评!在微信里做问卷调查,这 4 款小程序你一定会用到...
  16. Disconnected:No supported authentication methods available
  17. 制造企业生产管理创新理念
  18. Nat. Rev. Genet. | 通过可解释人工智能从深度学习中获得遗传学见解
  19. springboot中使用druid查询sqlite报错getFetchDirection error ResultSet closed
  20. fastapi 如何响应文件下载

热门文章

  1. 易基因|ctDNA甲基化测序分析(ctDNA-WGBS)用于癌症检测和分子分型 | 精准医学
  2. WIN10 DOS命令
  3. 学习-格鲁夫给经理人的第一课
  4. where 引导从句
  5. vs+html教学,VS Code怎么运行html文件
  6. Unity TimeLine丨A1.创建TimeLine、Animation Track,Extrapolation属性讲解
  7. vs用html制作表格,演练:在 Visual Web Developer 中编辑 HTML 表格
  8. 我用scratch做了个二分查找
  9. 【计算机网络】—— HTTP升级为WebSokect
  10. Java面试官:java高级工程师简历csdn