Click here to Skip to main content
15,883,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
we are giving a jar file to run on the client machine. using decrypt tool anybody can see the code inside the class file. i want to encrypt the .class file so, nobody can use my code.

What I have tried:

Proguard, java cryptography architecture
Posted
Updated 8-Jun-16 10:58am

Probably you should obfuscate your byte code, instead. See, for instance: obfuscation - Do you obfuscate your commercial Java code? - Stack Overflow[^].
 
Share this answer
 
Since ultimately, the JVM will have to read your file, you can't encrypt it.
But you can obfuscate the file as CPallini suggested in Solution 1 (How to encrypt a .class java file inside a jar[^]).
Obfuscating is a set of techniques that make reading the file difficult.
But there is also tools that beautify an obfuscated file and make it easier to read.
Free Javascript Obfuscator - Protects JavaScript code from stealing and shrinks size[^]
Javascript Obfuscate and Encoder[^]
Online JavaScript beautifier[^]
Javascript Beautifier and Formatter Online[^]

Chances are that commercial tools will be tougher than free ones.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900