Protect Tomcat Web App

GUI Tool

Execute protector4j-ui[.exe] in the tool's directory, you will see the interface below

Login

If you have got the license, you can click the login button on the top-right corner and type your account information. Although, without the license, you can also try it too.

Choose app type

Click the "Tomcat Web Application" button on the app types page.

Choose war/jar files to protect

Choose the war/jar files to protect, you can add single or multi jar files.

Choose classes to protect

Choose the classes to protect. On this page, you can just choose some key classes to encrypt or encrypt them all. The classes in the embed jar files are not supported to be encrypted now, they will keep as they are.

Output options

On this page, you can specify the Java version, the Tomcat version, the output folder, and the temp folder. After this is done, click the "Start" button on the bottom, it will start the encryption process.

Encryption process

It will take some time to finish the encryption process. After it is done, you can check the result in the output folder.

Check the result

After the encryption process complete, please go to the output folder to check the result. There is a tomcat folder with the web apps and the custom java runtime in it.

Run the encrypted app

Please go to the tomcat's bin directory, and use the startup.sh or startup.bat shell script to launch it.

For unix-like system

./startup.sh

For Windows

startup.bat

Every encryption task will request a new and unique key. The files that are been encrypted in different task can not be used together.

CLI Tool

The configuration of task file

Please find the task.tomcat.json in the tool's directory, copy and modify a new one.

{
"email" : "",
"password" : "",
"tomcatVersion" : "",
"jarsPath" : [ ],
"outputFolder" : "",
"tempFolder" : "",
"javaVersion" : "",
"version" : ""
}

The account information

If you have purchased our product, you would have got your account information including the email address and the password for the license. Please type them in the appropriate fields, the value of the password field should be the md5 value of the password, not the password itself. or you can leave the email and the password fields empty, just have a try to this tool.

"email" : "",
"password" : "[md5-of-password]",

Specify the jars and the classes need to be encrypted.

jarsPath

The jarsPath field is an array, which you could specify one or multi jar/war files that need to be processed in the encryption work.

"jarsPath" : ["path-to-jarfile1","path-to-jarfile2"],

Please use "\" as path seperator in Windows, as "C:\users\vlinx\jprotector", don't use "\"

protectAll

If this value is true, all the classes in the jar will be encrypted. But The classes in the embed jar files are not supported to be encrypted now, they will keep as they are.

classesToProtect

In this field, you can specify the classes that need to be encrypted. it can be a full class name, or wildcard case ones, just like:

"classesToProtect" : [
"vlinx.test.TestClass1",
"vlinx.test.pack1.*",
"vlinx.test.pack1.**"
],

* means all the classes in the package, but exclude the classes in the subpackage

** means all the classes in the package including the classes in the subpackage.

If the protectAll is true, this field will be ignored.

The classes in the embed jar files are not supported to be encrypted now, they will keep as they are

javaVersion

The java versions supported now are Java 8 and Java 11, you can type "java-8" for Java 8 and type "java-11" for Java 11

tomcatVersion

The tomcat versions supported now are Tomcat 8.5 and Tomcat 9.0. You can type "tomcat-8.5" for Tomcat 8.5, "tomcat-9" for Tomcat 9.0

tempFolder

The temp folder for the files generated during the encryption process, after the task completed, the files in the temp folder will be cleaned.

outputFolder

The encrypted app and the custom Java runtime will be placed into the output folder.

Execute the encryption process

Go the tool's directory and type the command below to execute the encryption process

protector4j -t tomcat -f path-of-task-file

-t task type

-f task file

You can type protector4j --help to see the detail arguments.

Check the result

After the encryption process, please go to the output folder to check the result. The encrypted jars and the custom java runtime are in there.

Run the encrypted app

Please go to the tomcat's bin directory, and use the startup.sh or startup.bat shell script to launch it.

For Linux and macOS

./startup.sh

For Windows

startup.bat

Every encryption task will request a new and unique key. The files that are been encrypted in different task can not be used together.