This question already has an answer here:

In JavaScript, it seems common for the official release of the code to use only single-character variable and function names (of course, after converting the original code which uses clearer names) in order to make the code more obscure. I've seen people reverse engineering software to find what seems to be the original variable (and maybe even function) names in the binaries. That helps people with debugging and developing their own code snippets to modify the software. However, it can also make it easier for malicious personnel to interpret and make malware for the code.

Is it a good idea to convert all variable and function names to single- (or double-) character names like with JavaScript before compiling to make the binaries more obscure (and I think a bit shorter too), which in turn makes it harder to reverse engineer?

marked as duplicate by Luc, MechMK1, Community Oct 14 at 8:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Often times what you are seeing with those few-character variables names is JS code that's been minified and packed down to reduce its size, allowing the client to download- sometimes significantly- fewer bytes than if the code was otherwise not minified; the slight obfuscation you are seeing is merely a byproduct and not the main goal of minification. Something like JS Compress can compress code up to 80%.

If you are seeking true obfuscation you could try something like obfuscator.io which can make it harder to decode what is actually going on, though it is important to note that all front-end code obfuscation techniques can be reversed. Obfuscation serves to slow attackers down rather than keeping information secured.

Not the answer you're looking for? Browse other questions tagged or ask your own question.