Security for jar

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Security for jar

 
0
  #1
Feb 16th, 2007
Hey guys..,
Plz Help me out for this.....
Is there any provision.... for giving security to a jar file.....i can easily unzip all the files from jar using winrar...

and we can easily get .java file from .class so i want to know is ther any way to provide security for jar file
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,426
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 258
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Security for jar

 
0
  #2
Feb 16th, 2007
No. You can obfuscate your code, or possibly try to create a native executable rather than a jarfile but both of these are equally useless. If someone wants your code they are going to get it.

The only way you prevent them getting your code is to not distribute it. In otherwords provide a web service or web site so that the consumer never gets your code onto his computer. But even then, reverser engineering can still be performed by determined people.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 74
Reputation: Cudmore is an unknown quantity at this point 
Solved Threads: 5
Cudmore's Avatar
Cudmore Cudmore is offline Offline
Junior Poster in Training

Re: Security for jar

 
0
  #3
Feb 16th, 2007
But even then, reverser engineering can still be performed by determined people.
Yea, like someone in serious need of "homework help".

Jars are just another archive-type file.. The purpose is to hold a number of files under a common name, "myfile.jar", to keep organized and to make it easier for the system to keep related class files all together. That could be reworded, but we know what I mean.

The best option is to create custom jar files and to place only the .class files inside the jar. Of course someone could still decypher the logic in the program by analyzing the compiled bytecode, but why? That's why commercial businesses compiles exe's, and not class files, no?
synchronized (theWorld) { System.out.println ("It's all mine..."); }
How many people have code in their Sigs?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Security for jar

 
0
  #4
Feb 16th, 2007
No, exes too can be easily decompiled and the source analysed (by someone who knows how).

ALL programs can be decompiled by someone who is determined enough.
The only reason some people ship what looks like executables when they ship Java programs is to enable them to be run on systems that have no JVM installed.
If you were to analyse those exes, you'd find that they're typically a JVM with all the classes added to the end as a jar file that's just copied into the exe and deflated at runtime.

Simple fact of life: The vast majority of peope couldn't care less about decompiling your program.
The vast majority of people (usually kids, almost never professionals) who think they need to "secure" their classes write code that's completely uninteresting to anyone who would look at it. There's nothing very clever or groundbreaking there that would give someone a business advantage for example.
The rest won't be stopped by anything.

If you don't want people to ever have the ability do decompile and read your sources, don't ship them.
Deliver your product/service through a web interface for example, or as a SOAP service.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 74
Reputation: Cudmore is an unknown quantity at this point 
Solved Threads: 5
Cudmore's Avatar
Cudmore Cudmore is offline Offline
Junior Poster in Training

Re: Security for jar

 
0
  #5
Feb 16th, 2007
Good thoughts. I've always been a strong supporter of the "open source" concept, even though (as you've made it clear) the source need not be distributed for another programmer to find out how the software was coded (logic, algorithms, etc). Just goes to show - you can't hide something if you give it away. And you're right. Code security does not beat performance and simplicity.
synchronized (theWorld) { System.out.println ("It's all mine..."); }
How many people have code in their Sigs?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Security for jar

 
0
  #6
Feb 17th, 2007
I'm not talking open source here, just common sense.
The best protection for your intellectual property is not letting it out the door.
If that's not possible, make sure your customers know what they're licensed to do and what the penalties are for doing things they shouldn't (like decompilation and illicit redistribution).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 871
Reputation: vinod_javas is an unknown quantity at this point 
Solved Threads: 7
vinod_javas's Avatar
vinod_javas vinod_javas is offline Offline
Practically a Posting Shark

Re: Security for jar

 
0
  #7
Feb 22nd, 2007
Thank you guys ...Finally i have decided to Opt this one to go ahead....

product/service through a web interface or as a SOAP service.
Adios,

Vinod......
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Security for jar

 
0
  #8
Feb 22nd, 2007
yup, that's a good way to do it. Do take into account the cost of running a stack of SOAP servers though in your price when you sell your service
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC