Protect License in JavaScript

Hi Team,

We are maintaining PDFTron license in JavaScript code, but it is somehow easily exposed as we can get the client code in Browser(even if it is minified). Is there any way to protect a license string in such a way that it should not be exposed to the user?

Regards,
Gowtham C

Hi Gowtham,

We are not aware of any truly reliable way to hide a license key string used by a JavaScript framework. Since the license key needs to be in client side JavaScript it’s not going to be possible to completely remove this risk. To make it more difficult for someone inspecting the code then you could run some obfuscation function on the string beforehand and then unobfuscate it in JavaScript before passing it to WebViewer. For example http://stackoverflow.com/questions/14458819/simplest-way-to-obfuscate-and-unobfuscate-a-string-in-javascript. You could also run your WebViewer creation code through a JavaScript obfuscator to make it more confusing to read.

Best Regards,
Armando Bollain
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original.