> 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 ;-)
>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.
> Hi all,
>
[quoted text clipped - 4 lines]
>
> Fred
Retroguard is a good obfuscator.