Try our best to protect java program
Introduction
Jar2Exe has provided a way to protect java program, that is to encrypt and hide jar files into exe file. Those protected programs cannot be extracted by compress software.
But as a software, we always cannot say our program is 100% safe. So what we can do is to increase the difficulty and cost of crack. In this chapter, we will discuss some third-party tools to co-operate with Jar2Exe.
Solution
Before "jar file encryption" by Jar2Exe, we can select "symbol obfuscation" by ProGuard. And after exe file created by Jar2Exe, we can select "exe file encryption" by ASProtect, from StarForce company.
Obfuscation of ProGuard let your java program not readable, but some other one can access your program as a whole jar file. Encryption of Jar2Exe let your java program not accessible but still runnable. "Exe file encryption" of ASProtect let the whole exe file encrypted again, unable to trace.
Features used
Following features and third-party tools are selected in this solution:
Feature | Advice | Introduction | How to enable |
---|---|---|---|
Obfuscation by |
Recommended |
Obfuscation by ProGuard let your java program not readable after de-compiled. |
Download from ProGuard homepage |
Encryption by |
Recommended |
Encryption by Jar2Exe let the whole jar file not accessible but still runnable. |
At Jar2Exe Step 4, check the encrypt option |
Self checksum |
Must be disabled |
Self checksum let generated exe file refuse to run when it is modified. If you want to use "exe file encryption" by ASProtect , 'Self checksum' must be disabled, then the exe file can be re-encrypted. This option is hidden and forced to be enabled when Jar2Exe is in trial period, only Activated Jar2Exe can disable this option. |
Purchase and Activate Jar2Exe, then at Step 6, uncheck 'Self checksum'. |
Exe encryption |
Recommended |
Exe encryption let the exe file encrypted again, unable to trace or debug. |
Steps with demo
The following steps will show obfuscation by ProGuard and jar file encryption by Jar2Exe and exe file encryption by ASProtect.
- The demo program is a simple calculator. ( Source code)
- Compile and pack into a jar file: SimpleCalc.jar. ( Jar file)
-
Use ProGuard to obfuscate jar file:
- Download and install ProGuard from http://proguard.sourceforge.net/#downloads.html
- Launch ProGuard by clicking ProGuard\bin\proguardgui.bat
- At "Input/Output" step, click "Add input" to select SimpleCalc.jar, click "Add output" to set a "SimpleCalc_obfuscated.jar".
- As a demo, we keep all options as default value, click "Next" until finish, we get a new obfuscated jar file.
- Run obfuscated file, to verify the obfuscated file is still runnable. ( Obfuscated jar file)
-
Encrypt obfuscated jar file into an exe file by Jar2Exe:
- Start Jar2Exe, at step 1, click Browse Jar and select SimpleCalc_obfuscated.jar
- At step 4, check the Encrypt and hide class files option.
- Please refer to other solutions for other options of Jar2Exe according to your program.
- At step 6, 'Self checksum' must be unchecked if you're going to encrypt it again by ASProtect
- Run generated exe file, to verify the generated file is runnable. ( Generated exe file by Jar2Exe)
-
Encrypt generated exe file by ASProtect
- Open ASProtect download site http://www.asprotect.com/downloads.html
- We select to download and install ASProtect Free Trial in our demo.
- Launch ASProtect, at "Application info" tab, select "SimpleCalc_obfuscated.exe" as "File to protect", set "SimpleCalc_encrypted.exe" as Output.
- At "Options" tab, check "Resources protection", check "Anti-debugger"
- At "Protect" tab, click Go to do encryption
- The 'SimpleCalc_encrypted.exe" may NOT able to run because the "extra data" is corrupted.
-
Fix Extra Data, the generated file of ASProtect may be NOT runnable, because "extra data" is corrupted, so we need to do a little fix.
- Download the little fix tool FixExtraData.exe
-
Run FixExtraData.exe, use SimpleCalc_obfuscated.exe and SimpleCalc_encrypted.exe as arguments
C:\> FixExtraData.exe SimpleCalc_obfuscated.exe SimpleCalc_encrypted.exe
- Then the SimpleCalc_encrypted.exe should be fixed and runnable.
- All these steps are a bit complex, if you failed, please contact support@jar2exe.com for help.
Download
- Download the final result, SimpleCalc_encrypted.exe
- solutions-all.zip - 11.3M, all solution related files in one file.
Comments
Hi
Hi
I want to enable checksum and sign the exe later. But im unable to do so. Please suggest a method
Hi
Hi
I want to enable checksum and sign the exe later. But im unable to do so. Please suggest a method
Add new comment