1.1.0 • Published 5 months ago

obfuscripter v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

JS Obfuscator Advanced

A modern, advanced JavaScript obfuscation tool built as an ES Module. Transform your JavaScript code to make it harder to reverse-engineer while maintaining functionality.

Features

  • Variable renaming with random identifiers
  • String encoding using hex transformation
  • Control flow flattening
  • Dead code injection
  • TypeScript and JSX support
  • Configurable obfuscation options

Installation

npm install obfuscripter

Usage

import { obfuscate } from 'obfuscripter';

const sourceCode = `
  const greeting = "Hello World";
  let count = 0;
  
  function sayHello(name) {
    if (name) {
      console.log(greeting + " " + name);
    } else {
      console.log("No name provided");
    }
    return count++;
  }
`;

const obfuscated = obfuscate(sourceCode, {
  renameVariables: true,
  encodeStrings: true,
  flattenControlFlow: true,
  injectDeadCode: true
});

console.log(obfuscated);

Options

The obfuscator accepts an optional configuration object with the following properties:

OptionTypeDefaultDescription
renameVariablesbooleantrueRename variables to random IDs
encodeStringsbooleantrueEncode string literals to hex
flattenControlFlowbooleantrueFlatten if-statements to switches
injectDeadCodebooleantrueAdd unreachable code blocks

Example with custom options:

const obfuscated = obfuscate(code, {
  renameVariables: true,
  encodeStrings: false,
  flattenControlFlow: true,
  injectDeadCode: false
});

Requirements

  • Node.js 14+ (for ES module support)
  • npm 6+

Development

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Make changes in src/index.js

License

MIT License - see LICENSE for details

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Disclaimer

While this obfuscator makes code harder to read, it is not a foolproof security solution. Obfuscation can be reversed with sufficient effort. Use additional security measures for critical applications.