Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is code obfuscation really useful in javascript?

Recently I have passed to gulp task manager, and I noticed that by default, build task produce .map files. This makes me wonder: is useful to obfuscate code for production deployment? Does it protect my software from being hacked? If yes, should I delete my .map files from there?

like image 559
Nemus Avatar asked Jun 01 '16 07:06

Nemus


People also ask

Should I obfuscate JavaScript?

While JavaScript obfuscation is often the entry point for those looking for some degree of source code protection, the bottom line is that obfuscation is usually a means to an end. While developing your application's threat model, it's important to understand the risks posed by unprotected JavaScript code.

How secure is JavaScript obfuscation?

A obfuscator won't help you at all if someone wants to figure out the code. The code still exists on the client machine and they can grab a copy of it and study it at their leisure. There is simply no way to hide code written in Javascript since the source code has to be handed to the browser for execution.

Does obfuscation affect performance JavaScript?

Name obfuscation does not affect the performance and should always be used. You can virtualize methods that are not computationally intensive.

Does code obfuscation work?

Obfuscation makes it much more difficult for attackers to review the code and analyze the application. It also makes it hard for hackers to debug and tamper with your application.


1 Answers

Simple obfuscation will not protect your software from being hacked. If you really want to protect your javascript, to add something that will make the life of someone who tries to steal or tamper with your software really difficult, you should check Jscrambler. I have not yet seen any solution that goes even close to the level of protection they enable you to achieve.

As for the source maps question, if you obfuscate yes you should delete them.

like image 197
Carl Rck Avatar answered Oct 21 '22 03:10

Carl Rck