• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unextratable jar file

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi !!
How can i create a jar file which anybody can not able to extract.
Pl. reply me if any body is having solution for this.
Regards,
Mahendra
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that some ZIP utilities can place a password on a ZIP file. However, I don't know if all ZIP decompressers respect this password. (A cursory glance through that java.util.zip and java.util.jar APIs turned up no reference to a password feature, so I assume that you could use jar.exe to extract a ZIP file that was password protected.)
What cames to mind would be to write a program that took a .jar file as an argument, read the bytes of the file and alter them using some algorithm that you wrote. You would then have to write a ClassLoader that could take one of these resulting files, reverse-engineer it to retreive the original .jar file, and then load the classes from that.
(Please note that this is just a theoretical solution--I take no blame for its impracticality )
[ May 24, 2003: Message edited by: Joel McNary ]
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not clear what your goal is here. A "jar file" is a format that, by design, anyone can extract from. If you change the file so it's no longer extractable, it's not really a jar file any more.
What's in the jar file? If you're using it for storing something other than .class files, then there are various ways you can encrypt the contents of a file. However if you're talking about the most common situation in which the jar file contains .class files which must be accessible and understandable by a JVM, then fundamentally it's not going to be possible to prevent people from accessing the original .class file. Evn if you bury it under one or more layers of encrytion and decryption - the JVM still needs to be able to receive an unecrypted version, or the class won't load. And it's always possible for someone to hack a JVM (source code for some versions is freely available) to copy the unencrypted version to a file. See this article for details.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic