Javascript源码加密工具

记录一些常用的js源码混淆加密工具
更新于: 2021-12-26 10:06:23

工具1:javascript-obfuscator

https://obfuscator.io/

A free and efficient obfuscator for JavaScript (including partial support of ES2019). Make your code harder to copy and prevent people from stealing your work. This tool is a Web UI to the excellent (and open source)

 

看下面这段代码

实际应该是没有 format 的源码

(function (_0x56450e, _0x57751c) {
  var _0x51ff41 = _0x85d7,
    _0x39c0d8 = _0x56450e();
  while (!![]) {
    try {
      var _0x24ed36 =
        (parseInt(_0x51ff41(0xd6)) / 0x1) * (parseInt(_0x51ff41(0xdc)) / 0x2) +
        (-parseInt(_0x51ff41(0xdb)) / 0x3) * (parseInt(_0x51ff41(0xd3)) / 0x4) +
        -parseInt(_0x51ff41(0xd2)) / 0x5 +
        parseInt(_0x51ff41(0xd8)) / 0x6 +
        -parseInt(_0x51ff41(0xd4)) / 0x7 +
        (-parseInt(_0x51ff41(0xd9)) / 0x8) *
          (-parseInt(_0x51ff41(0xd5)) / 0x9) +
        (-parseInt(_0x51ff41(0xd7)) / 0xa) * (parseInt(_0x51ff41(0xde)) / 0xb);
      if (_0x24ed36 === _0x57751c) break;
      else _0x39c0d8["push"](_0x39c0d8["shift"]());
    } catch (_0x3d66c4) {
      _0x39c0d8["push"](_0x39c0d8["shift"]());
    }
  }
})(_0x5db8, 0xb0df3);
function hi() {
  var _0x495c93 = _0x85d7;
  console[_0x495c93(0xda)](_0x495c93(0xdd));
}
function _0x5db8() {
  var _0x4f1c43 = [
    "5413250DetqVX",
    "7961184egRlft",
    "16yhxzYN",
    "log",
    "1182ZPpHDa",
    "4IPEHvx",
    "Hello\x20World!",
    "11NCJRjN",
    "3550965hkmslU",
    "316PudqjU",
    "2073001MareCN",
    "2944278jqMAem",
    "161053MXngtz",
  ];
  _0x5db8 = function () {
    return _0x4f1c43;
  };
  return _0x5db8();
}
function _0x85d7(_0x329ceb, _0x17c8f6) {
  var _0x5db824 = _0x5db8();
  return (
    (_0x85d7 = function (_0x85d7dd, _0x257ec2) {
      _0x85d7dd = _0x85d7dd - 0xd2;
      var _0x29bec8 = _0x5db824[_0x85d7dd];
      return _0x29bec8;
    }),
    _0x85d7(_0x329ceb, _0x17c8f6)
  );
}
hi();

看源码

// Paste your JavaScript code here
function hi() {
  console.log("Hello World!");
}
hi();

参考