跪拜 Guibai
← All articles
Frontend · JavaScript

AI Still Can't Reliably Reverse JavaScript Obfuscation

By w2sfot ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The claim that AI has killed client-side code protection is premature. Obfuscation remains a cheap, effective deterrent that raises the cost of reverse engineering, and the tooling is already adapting with AI-resistant techniques.

Summary

A practical test feeds obfuscated JavaScript into an AI tool and compares the output against the original code. The restored result is far from the original — variable names, control flow, and logic remain scrambled. Multiple code samples produce the same poor outcome.

A newer category of "anti-AI reverse JS encryption" adds another layer specifically designed to resist LLM-based deobfuscation. Tests on these hardened samples show AI tools fail to recover anything close to readable source.

The conclusion is blunt: JS obfuscation still works. AI cannot simply "crack" obfuscated code back to its original form. Even if it could, forcing an attacker to run an AI pipeline is still a higher bar than shipping plaintext source.

Takeaways
AI tools tested against obfuscated JS produce output that differs substantially from the original code.
Multiple obfuscated samples all failed to be meaningfully restored by AI.
"Anti-AI reverse JS encryption" tools now exist that specifically target LLM-based deobfuscation attempts.
Even if AI could eventually restore obfuscated code, requiring an attacker to run that process is still better than shipping unprotected source.
Conclusions

The rumor that AI makes obfuscation useless confuses "can produce some output" with "can produce correct output." AI tools generate plausible-looking but functionally wrong code from obfuscated input.

Obfuscation is entering an adversarial cycle: as LLMs get better at pattern matching, obfuscators add transformations designed to exploit LLM weaknesses, such as misleading semantic cues.

The practical security bar is not whether AI can theoretically deobfuscate code, but whether the cost and accuracy of doing so make it worthwhile for an attacker.

Concepts & terms
JS Obfuscation
A technique that transforms JavaScript source code into an equivalent but extremely difficult-to-read version by renaming variables, altering control flow, and encoding strings, without changing the program's behavior.
Anti-AI Reverse JS Encryption
A newer class of JavaScript protection that adds transformations specifically designed to confuse large language models attempting to deobfuscate the code, such as inserting misleading semantic patterns.
From the discussion

The discussion pushes back on the article's framing. The real goal of reverse engineering obfuscated JavaScript is rarely full source restoration; it's targeted extraction of critical logic, function signatures, and parameters. A second point argues that obfuscation techniques like pervasive array indirection remain effective against AI, which may grasp isolated semantics but cannot reconstruct a coherent project structure.

Reverse engineering obfuscated JS is about extracting key functions and parameters, not restoring original source code.
Obfuscation that replaces everything with array lookups still defeats AI restoration, even if the AI understands some individual code meanings.
AI cannot recover the structure of an entire engineering project from obfuscated output.
Featured comments
吃瓜群众_混子

The point of cracking JS isn't to restore the code—it's to extract key functions, parameters, etc... to get what you need.... [laugh]

AI智能灌水助手

Use arrays throughout the entire code; let's see how it restores that. Of course, some code semantics can still be immediately recognized by AI, but it just can't recover an engineering project.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗