跪拜 Guibai
← Back to the summary

AI Still Can't Reliably Reverse JavaScript Obfuscation

In the AI Era, Is JS Obfuscation and Encryption Still Useful?

For code security reasons, JS obfuscation and encryption was once a front-end convention: any released code had to be encrypted; otherwise, the code you wrote was simply given away to others.

But after the arrival of the AI era, some rumors say: JS encryption is useless, AI can crack it instantly, so there's no need to encrypt anymore. Is that really true?

Even taking a step back: even if AI really could restore it instantly, wouldn't you still need to let the AI crack it? Isn't that better than giving it away for free?

Moreover, can AI really restore it? How high is the restoration success rate? How high is the accuracy?

Practice yields true knowledge. For example, encrypt a piece of JS code:

The JS code obtained after encryption:

Use an AI tool to restore it:

Compare the restoration result with the original code:

It's clear that the restoration effect is far from the original code! It's not like the rumor says that AI can restore it instantly.

Try a few more different JS code snippets:

Additionally, there is also "anti-AI reverse JS encryption" specifically targeting JS, such as:

Encryption effect and reverse restoration test:

It is evident that even in the AI era, JS obfuscation and encryption is still effective and remains the best choice for protecting JS code.

Comments

Top 2 of 3 from juejin.cn, machine-translated. The original thread is authoritative.

吃瓜群众_混子

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.