Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/nstarke/egodeath
Static AnalysisCode AnalysisReverse EngineeringPapers & ResearchLearning & Education
GitHubnstarke/egodeath

egodeath

A JavaScript Obfuscator based on Cryptographic Indistinguishability Obfuscation techniques

View Repository
5351 month agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

egodeath

This project does not achieve indistinguishability obfuscation. You should not be using this to product to protect secrets. It exists to deter reverse engineering, not prevent it

Tests

images/screenshot.png A JavaScript obfuscator designed to make code extremely difficult to read and analyze for both humans and LLMs. Written in TypeScript. Implements techniques from peer-reviewed cryptographic obfuscation research.

Installation

root@kitploit:~
npm install
npm run build

CLI Usage

root@kitploit:~
# Basic usage
node dist/index.js input.js > output.js

# With target token budget (default: 2,000,000)
node dist/index.js --target-tokens 500000 input.js > output.js

# Minimal obfuscation (small output)
node dist/index.js --target-tokens 10000 input.js > output.js

# Maximum bloat (10M tokens)
node dist/index.js --target-tokens 10000000 input.js > output.js

# Using environment variable
INPUT_FILE=input.js node dist/index.js > output.js

# Help
node dist/index.js --help

Options

OptionDefaultDescription
--target-tokens <n>2000000Target output size in tokens. Small inputs are bloated up to this limit. Large inputs produce less bloat to stay within budget.
--help, -hShow help message

npm scripts

root@kitploit:~
npm run build              # Compile TypeScript to dist/
npm run start              # Run the obfuscator (reads input.js)
npm run test               # Run the test suite
npm run obfuscate-package  # Run compatibility tests against npm packages

Programmatic API

root@kitploit:~
const { obfuscate } = require('./dist/obfuscator');

const code = 'function add(a, b) { return a + b; }';
const obfuscated = obfuscate(code);

// With options
const obfuscated = obfuscate(code, { targetTokens: 500000 });

Transform Pipeline

The obfuscator applies 20 transforms across 4 phases. Each stage builds on the previous one.

Phase 1: Security & Anti-Analysis Pre-transforms

Phase 2: Structural Pre-transforms

Phase 3: Identifier Passes

Phase 4: Post-transforms

Dead Code Injection

Dead code is injected at multiple points with two generation strategies:

StrategySourceDescription

Dead code injection points:

  • CFF dead switch cases (~30% extra per function, scaled by budget)
  • Opaque predicate else branches
  • Standalone dead blocks in non-CFF functions (budget-controlled)

Research Paper References

Several transforms are inspired by peer-reviewed cryptographic obfuscation research:

Verification Tools

Two verification tools measure obfuscation quality, located in src/verification/:

Null Circuit Test (verification/nullCircuitTest.ts)

Obfuscates a real function and a "null" function (same shape, does nothing), then compares 14 structural metrics to score how distinguishable they are. Higher similarity = better obfuscation.

root@kitploit:~
import { runNullCircuitTest } from './verification/nullCircuitTest';
const result = runNullCircuitTest(realCode, paramCount, stmtCount, threshold, targetTokens);
console.log('Similarity:', result.similarity); // 0.0-1.0

Unobfuscatable Function Tests (verification/unobfuscatableTests.ts)

7 test cases from Paper 1's impossibility proofs that attempt to extract secrets from obfuscated code:

root@kitploit:~
import { runAllTests, printSummary } from './verification/unobfuscatableTests';
console.log(printSummary(runAllTests(10000)));

Tests: point function (password), magic numbers, canary strings, embedded keys, URLs, regex patterns, control flow signatures.

Output Size Budget

The --target-tokens option controls output size via a bloat budget that scales dead code injection (the primary volume lever). Budget-gated transforms:

Budget RatioTransforms Enabled
> 3Anti-debug, tripwires, CFF, opaque predicates, comma merging
> 5Proxy functions, property key encoding, noise injection, self-integrity
> 8Context window exhaustion
> 10Global variable encoding

Dead code multiplier scales from 1x (ratio 30) to 150x (ratio 1500+), controlling the number and size of dead switch cases and opaque predicate branches.

Project Structure

root@kitploit:~
src/
  index.ts              CLI entry point
  obfuscator.ts         Main pipeline orchestrator (20 transforms)
  options.ts            Budget system and options
  types.ts              AST type definitions
  random.ts             Random Unicode name generation (6-16 chars, 16 script ranges)
  ast.ts                AST node factory functions
  keywords.ts           Dynamic keyword discovery (globalThis + window package)
  globals.ts            Global state management (null-prototype maps)
  substitute.ts         Identifier substitution utilities
  declarations.d.ts     Module type declarations
  passes/
    firstPass.ts        Identifier cataloging
    secondPass.ts       Identifier substitution + string encoding
    thirdPass.ts        Dummy parameter injection
  transforms/
    antiDebug.ts        eval("debugger") traps + setInterval loops
    tripwires.ts        Punctured program secret-input checks [Paper 4]
    noiseInjection.ts   LPN-inspired arithmetic noise [Paper 7]
    controlFlowFlattening.ts  while/switch + modular arithmetic dispatch [Paper 3]
    opaquePredicates.ts       15 always-true/false math predicates
    proxyFunctions.ts         Call graph flattening dispatchers
    contextExhaustion.ts      Ternary/void noise for LLM context filling
    commaExpressions.ts       Statement merging via comma operator
    globalVariableEncoding.ts eval+replace for globals
    propertyKeyEncoding.ts    Computed property access with per-scope registries
    numberEncoding.ts         11 bitwise/arithmetic encoding strategies
    selfIntegrity.ts          Anti-tamper runtime checks [Paper 10]
    stringArrayExtraction.ts  Chained XOR + sparse position errors [Papers 2, 9]
    deadCodeInjection.ts      Template + mutation-based dead code [Paper 3]
  verification/
    nullCircuitTest.ts        Dead code quality scoring [Paper 10]
    unobfuscatableTests.ts    Secret extraction test cases [Paper 1]
  __tests__/                  300+ unit tests across 21 suites
tools/
  obfuscate-package.ts  Webpack-based npm package compatibility testing
tests/
  input*.js             Original test input files

Testing

root@kitploit:~
# Run all tests
npm test

# Run a specific test suite
npx jest controlFlowFlattening
npx jest tripwires
npx jest noiseInjection

# Test against npm packages (clones repos, webpack-bundles, obfuscates, runs tests)
npm run obfuscate-package                    # All 10 packages
npm run obfuscate-package -- minimist semver # Specific packages

Compatibility Test Tool

The tools/obfuscate-package.ts tool tests the obfuscator against real npm packages:

  1. Clones the package's git repository
  2. Installs all dependencies (including devDependencies for testing)
  3. Builds the package if it has a build script
  4. Uses webpack to bundle the library's main entry point into a single CommonJS file
  5. Runs the obfuscator on the bundled file
  6. Replaces the library's main entry with the obfuscated bundle
  7. Runs the library's own test suite against the obfuscated version

Output locations

PathContents
dist/obfuscated/<package>/bundle.jsThe obfuscated webpack bundle for each package
dist/obfuscated/report.jsonFull JSON report with bundle sizes, obfuscation status, test output

License

MIT - Copyright 2026 Nicholas Starke

Download Tool
OrderTransformFileDescription
1Anti-Debug Trapstransforms/antiDebug.tsInjects eval("debugger") statements and 10-20 setInterval loops with prime-number intervals (5s-600s) that repeatedly trigger debugger breakpoints. Each instance uses unique encoded strings.
2Punctured Program Tripwirestransforms/tripwires.tsEmbeds hidden checks comparing parameter hashes against secret values. 5 hash patterns (bitwise fingerprint, modular arithmetic, charCodeAt, numeric hash, typeof+length). Triggers silent state corruption, busy loops, or throws on secret inputs. [Paper 4]
3LPN Noise Injectiontransforms/noiseInjection.tsAdds and cancels random noise through split paths in arithmetic computations. 6 patterns: add/sub, XOR, mul/div, split dual-variable, computed hash-chain, bit-rotate. Intermediate values are meaningless without tracing full cancellation. [Paper 7]
OrderTransformFileDescription
4Control Flow Flatteningtransforms/controlFlowFlattening.tsConverts function bodies into while(true) { switch((_s * P) % M) { ... } } state machines with modular arithmetic dispatch — case values are encoded through (stateId * multiplier) % modulus using random prime parameters. [Paper 3]
5Opaque Predicatestransforms/opaquePredicates.tsInjects if conditions that always evaluate to true or false but are mathematically hard to prove (e.g., (x*x+x)%2===0). 15 predicate formulas across modular arithmetic, bitwise, and type-check categories.
6Proxy Functionstransforms/proxyFunctions.tsRoutes all function calls through two dispatchers: _fc(fn, ...args) for simple calls, _mc(obj, prop, ...args) for method calls. Uses Function.prototype.apply captured in a local variable for resilience.
7Context Window Exhaustiontransforms/contextExhaustion.tsWraps expressions in deeply nested ternaries with opaque conditions, void-expression chains, and conditional void padding. Forces LLMs to waste context window tokens on noise.
8Comma Expression Mergingtransforms/commaExpressions.tsCollapses consecutive expression statements into single comma expressions: a(); b(); return c() becomes return a(), b(), c().
OrderPassFileDescription
9Pass 1: Catalogpasses/firstPass.tsTraverses the AST and catalogs every identifier, building a globals map that assigns each a random 6-16 character Unicode name drawn from 16 script ranges (CJK, Hangul, Greek, Cyrillic, Devanagari, Thai, Arabic, Katakana, etc.).
10Pass 2: Substitutepasses/secondPass.tsReplaces all identifier names with their obfuscated Unicode equivalents. Encodes require() arguments as String.fromCharCode(...). Encodes static import/export sources as unicode-escaped string literals. Substitutes class superClass references, template literal expressions, destructuring patterns.
11Pass 3: Dummy Parameterspasses/thirdPass.tsInjects 0-15 random unused parameters into every function declaration and expression. Skips functions with rest parameters. Strips all comments.
OrderTransformFileDescription
12Global Variable Encodingtransforms/globalVariableEncoding.tsReplaces references to globals (dynamically discovered from globalThis + window package) with eval("Name<suffix>".replace(new RegExp("<suffix>$"), "")). Both strings flow through the string array.
13Property Key Encodingtransforms/propertyKeyEncoding.tsConverts dot access to computed access with per-scope registries. Cross-scope access works because all suffixes resolve to the same property name at runtime via .replace().
14Number Encodingtransforms/numberEncoding.ts11 encoding strategies: shift+add, XOR identity, complement, division, nested shifts, double-NOT, modular, etc. Each instance uniquely generated. Skips property keys and switch case values.
15Self-Integrity Verificationtransforms/selfIntegrity.tsInjects 2-4 runtime checks: eval native-code verification, Function.prototype.toString integrity, timing anomaly detection, code structure validation. Anti-tamper responses: busy wait, throw, silent corruption. [Paper 10]
16String Array Extractiontransforms/stringArrayExtraction.tsCollects all strings into a single array with chained XOR decryption (key for entry N depends on decoded content of entry N-1) and sparse position-dependent error patterns (each character gets a different XOR key, with LPN-inspired sparse errors at select positions). [Papers 2, 9]
17Console Stubsobfuscator.tsDynamically discovers all console methods and sets each to a no-op function.
18Terser Minificationobfuscator.tsStrips whitespace/formatting via terser (mangle: false, compress: false). Falls back to regex-based stripping if terser can't parse the output.
Template-based
transforms/deadCodeInjection.ts
9 template types: loop accumulation, array building, object manipulation, string concatenation, nested conditionals, try/catch, while countdown, switch computed, bitwise chains. Templates reference real scope variables.
Mutation-basedtransforms/deadCodeInjection.tsClones REAL statements and mutates them: swaps operators within equivalence groups, perturbs constants, renames identifiers. Produces AST-structurally-identical dead code that is indistinguishable from real code by structure alone. [Paper 3]
PaperAuthorsTechnique Implemented
[Paper 1] On the (Im)possibility of Obfuscating ProgramsBarak, Goldreich, Impagliazzo, Rudich, Sahai, Vadhan, YangUnobfuscatable function test cases — verification tool that tests if secrets survive obfuscation
[Paper 2] Candidate iO and Functional Encryption for all CircuitsGarg, Gentry, Halevi, Raykova, Sahai, WatersChained string decryption — Kilian-style randomization where each entry's key depends on the previous decoded string
[Paper 3] iO from the Multilinear Subgroup Elimination AssumptionGentry, Lewko, Sahai, WatersMutation-based dead code (structurally identical to real code); modular arithmetic state transitions in CFF
[Paper 4] How to Use iO: Deniable Encryption, and MoreSahai, WatersPunctured program tripwires — hidden checks that trigger on secret inputs
[Paper 7] iO from Well-Founded AssumptionsJain, Lin, SahaiLPN-inspired noise injection in numeric computations
[Paper 9] iO from Bilinear Maps and LPN VariantsRagavan, Vafa, VaikuntanathanSparse XOR encoding with position-dependent error patterns
[Paper 10] iO of Null Quantum Circuits and ApplicationsBartusek, MalavoltaNull circuit test for dead code quality verification; self-integrity verification (dual-mode)