Full-stack JavaScript Source Code Protection

By Pedro Fortuna 4 min read

Good news for the Node.js aficionados! Jscrambler now officially supports protecting the source code of Node.js apps. If you have been paying attention, Node.js has undoubtedly risen.

Perhaps you are already using it! In the last two years, we have received numerous requests from Node.js developers to support Node.js obfuscation. Woohoo! We are now delivering.

Developing Node.js support was fun and had a big impact on our development team.

After getting our knees deep in Node.js development, we decided to switch from PHP + Zend to Node.js. Node.js brings tons of advantages.

We are happy to announce that JScrambler is the first Full-stack JavaScript source code protection on the market.

We already supported protecting client-side JS.

Now, all source code transformations work with Node.js. To support Node.js, we had to update the source code transformations that injected DOM objects into the protected code (e.g., window).

The exceptions are Domain Lock, Browser, and OS Lock; these source code transformations are meant for client-side code only and don’t make sense on the backend. When you select the Node.js application mode, these transformations will be unavailable.

Jscrambler 3.6

Jscrambler 3.6 now supports Node.js source code protection. Of course, not everyone will need to protect Node.js apps, but there are two scenarios where it makes sense:

You are delivering your Node.js code to others

Perhaps you custom-develop applications for other companies.

Naturally, you’ve probably invested in a codebase for each customer to speed up development and offer competitive prices.

With time that common codebase will have a lot of time and money invested in. In that case, you may consider protecting your sources to reduce the risk of this code leaking out.

Leaked code may fall into the hands of competitors, who may inspect it to learn about it and perhaps some business details. Or it may encourage new competitors to open up a store on the other side of the street without the initial investment (i.e., developing your codebase).

Neither wants to build upon it. Most developers react badly when they need to build on a bad developer’s work. Imagine building on top of heavily obfuscated code. Existing or new competitors might try to reverse-engineer your code, and protecting it can help prevent IP legal disputes.

Protecting your codebase will also discourage clients from hacking it. Whether to unlock features or pirate it, you’ll want to stop them from violating your license agreement.

You deploy Node.js apps to the Cloud / shared hosting

The cloud has done an immense amount for the Web.

You can deploy your Web Apps to a virtual server and not spend a minute worrying about server outages. However, we all felt a bit nervous about putting our code on a server where you don’t know who has access to it or how strictly the security policies are followed.

By protecting your sources, you’ll add an extra layer of security in case others access your code.

In summary, by protecting your code, you can reduce the risk of:

  • your code leaking out and giving out details of your work to existing competitors
  • your code leaking out and being used to bootstrap new competitors
  • your code being hacked by your clients to unlock features
  • your code being leaked onto the Internet and pirated
  • your license agreement is being violated
  • your code being accessed by others in Cloud / shared hosting environments
  • dealing with IP legal disputes

To test the compliance of Jscrambler with Node.js, we used the unit tests from the most used npm libraries, such as Express, Koa, etc. We passed all of them.

Jscrambler integration, plans, and pricing

If you don’t know where to start, you’ll need a Jscrambler account.

Just register a trial account at Jscrambler. If you are just interested in minifying or compressing your code, you may be glad to hear that Jscrambler is free for that purpose. You can use the API too.

Jscrambler provides several resources to integrate into your build process.

It’s very easy to integrate Jscrambler in your Node.js build environment as it already supports both Grunt and Gulp. If you use neither, you can grab the API client and customize it to fit your needs. If that still doesn’t work for you, you can always use the API CLI executable, which you can run from your scripts or your IDE.

To configure any of the API clients, you just need to grab your API keys and write a config.json file listing the source code transformations you want to use. It’s simple. If you are doing Full-stack JavaScript Web Apps and you want to secure your code, give Jscrambler a try.