Ask coding questions

← Back to all posts
How can I make a Javascript Obfuscator?
h
Battledash2 (79)

Hello There, I'm trying to learn how to make a JS Obfuscator which Obfuscates JS. I tried searching some stuff up but there's nothing on how to make a javascript obfuscator. All help would be really appreciated.

I am well aware there is a nodejs module and a website called obfuscator.io but I would like to do it myself without any sort of library.

Thanks,
-Battledash2

Comments
hotnewtop
Coder100 (17038)

Fine then

click to fork

hmm that's html, I'm sure you will be able to understand my 'comments' (this is super old code sorry)

Battledash2 (79)

Ahh yes. But for javascript not HTML :) @Coder100

CSharpIsGud (922)

First off, you're probably going to want to use some form of a parser to be able to parse js.

If you try to just use regex I assure you that you won't be able to obfuscate that much and it will be humanly reversible in a relatively short amount of time.

Battledash2 (79)

No, I want it to obfuscate not minify. Minfiers can be prettyafied. I want it like https://obfuscator.io @Coder100

Battledash2 (79)

I already know how to make a minifier @Coder100

Coder100 (17038)

WAIT WHAT THAT'S NOT A REAL MINIFIER @Battledash2

Battledash2 (79)

?? It removed backspaces :P not very real ik but idc about file size @Coder100