2

I checked the minifier tools out there for JS

They take some code like this

function sayHello(){
   alert('hi');
}

and give you back something like this:

function sayHello(){alert("hi")}

which is uglified and compressed ( hence minified) but still can be reverse engineered.

But I do know there are cases where the function name is also modified. Those not only compress and uglify the js, it but also, makes it practically impossible to reverse engineer...

The code in those changes the func and var names so sayHello may end up being "a" or "b" etc..

What is this process called? Is there an online tool where you supply your JS and it gives you back that kind of a minification?

  • 1
    It's called obfuscation. Minification aims to reduce bandwith, obfuscation tries to make the code unreadable also. – Andreas Dolk May 25 '20 at 16:18
  • 3
    The process *is* called "minification". – VLAZ May 25 '20 at 16:18
  • 1
    "practically impossible to reverse engineer". No way! – ggorlen May 25 '20 at 16:19
  • Does this answer your question? [How can I obfuscate (protect) JavaScript?](https://stackoverflow.com/questions/194397/how-can-i-obfuscate-protect-javascript) – ggorlen May 25 '20 at 16:19
  • 1
    Obfuscation -> trying to make the code incomprehensible and/or prevent reverse engineering. Minification -> reduce size of code. – ggorlen May 25 '20 at 16:20
  • To be clear, the purpose of minification is primarily to save bandwidth and time. It makes your code less easy to read, but it certainly doesn't make it impossible to reverse engineer. In fact it doesn't need any engineering of any sort, it's still valid executable source code and could be used by anyone, as-is in its minified state. Harder to alter without putting in more work to understand it, but it's certainly not un-stealable – ADyson May 25 '20 at 16:21
  • 1
    Your example only exhibits the removal of unnecessary whitespace. That's just a small part of minification. Shrinking local identifiers is another. – Bergi May 25 '20 at 16:21

1 Answers1

1

You want to obfuscate your code.

As Andreas wrote:

Minification aims to reduce bandwith, obfuscation tries to make the code unreadable also

There are some libs that can obfuscate your JS code:

You could also check online tools:

rap-2-h
  • 30,204
  • 37
  • 167
  • 263
  • 2
    Seems like this could be a comment. The question is basically asking for online tools which is [off-topic](https://stackoverflow.com/help/on-topic) for Stack Overflow. – ggorlen May 25 '20 at 16:21