Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / July 2004

Tip: Looking for answers? Try searching our database.

How to encrypt a jar file ?

Thread view: 
Boniface Frederic - 30 Jun 2004 12:33 GMT
Hi all,

I would like to know how if it is possible to encrypt a .jar file so that a
decompression and decompilation do not allow to view readable java file.

Thanks a lot.

Fred
Stefan Waldmann - 30 Jun 2004 13:16 GMT
> Hi all,
>
[quoted text clipped - 4 lines]
>
> Fred

Hello,

I don't think that there is a possibility to encrypt the jar file so
that the Java VM still can deal with it. Unless you would use your own
classloader which decrypts the jar files before loading classes from it.
This class loader must be located outside of your encrypted jar file of
course.

What you could do is use an obfuscator (google will help ;-), which
renames your variable and method names to a, b, c, d(), e(), f() and so
on, which makes it hard for anybody who decompiles your classes to read
the code.

Regards,
Stefan
Andrew Thompson - 30 Jun 2004 13:39 GMT
>> I would like to know how if it is possible to encrypt a .jar file so that a
>> decompression and decompilation do not allow to view readable java file.
...
> What you could do is use an obfuscator ..

For more info..
<http://mindprod.com/jgloss/obfuscator.html>

Signature

Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

Roedy Green - 30 Jun 2004 18:15 GMT
>I don't think that there is a possibility to encrypt the jar file so
>that the Java VM still can deal with it. Unless you would use your own
>classloader which decrypts the jar files before loading classes from it.
>This class loader must be located outside of your encrypted jar file of
>course.

But then it is trivial to hack the custom classloader and get it to
dump out the unencrypted class files as a side effect.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Stefan Waldmann - 01 Jul 2004 08:20 GMT
>>I don't think that there is a possibility to encrypt the jar file so
>>that the Java VM still can deal with it. Unless you would use your own
[quoted text clipped - 4 lines]
> But then it is trivial to hack the custom classloader and get it to
> dump out the unencrypted class files as a side effect.

That's why i suggested the Obfuscator ;-)
Roedy Green - 30 Jun 2004 18:14 GMT
>I would like to know how if it is possible to encrypt a .jar file so that a
>decompression and decompilation do not allow to view readable java file.

Think for a second what you have asked. If nobody can decompress or
decompile it, how can anybody RUN it?

If you can run it, then you must have given the keys to run it to some
piece of software to decrypt it.  It now becomes possible to repeat
that, at least in theory.

See http://mindprod.com/jgloss/obfuscator.html

I tackle this problem in my dark room essay.  See
http://mindprod.com/jgloss/darkroom.html

However, my scheme requires special hardware that does not exist on
the open market.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Jean Charbonneau - 30 Jun 2004 18:40 GMT
> Hi all,
>
[quoted text clipped - 4 lines]
>
> Fred

Retroguard is a good obfuscator.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.