Encrypting Java Code  
Author Message
mike





PostPosted: 2005-10-31 23:33:00 Top

java-programmer, Encrypting Java Code

I provide a Web service that is mostly JSP with a few java classes
thrown in. I want to give my customers the ability to down load a
subset of the service's functionality (JSPs) to run offline.

How can I encript the code so that it cannot be reversed engineered?
If it encripted, is there a performance hit?


Thanks



 
Daniel Dyer





PostPosted: 2005-11-1 0:10:00 Top

java-programmer >> Encrypting Java Code On Mon, 31 Oct 2005 15:32:55 -0000, Mike <email***@***.com> wrote:

> I provide a Web service that is mostly JSP with a few java classes
> thrown in. I want to give my customers the ability to down load a
> subset of the service's functionality (JSPs) to run offline.
>
> How can I encript the code so that it cannot be reversed engineered?
> If it encripted, is there a performance hit?
>
> Thanks

In short, you can't. The best you can achieve is obfuscatation to make
things more difficult, but there is nothing you can do to protect your
code from a determined reverse engineer.

You may have heard of schemes for encrypting class files, but these do not
work (see
http://www.javaworld.com/javaworld/javaqa/2003-05/01-qa-0509-jcrypt.html).

For a good, free obfuscator, try Proguard
(http://proguard.sourceforge.net).

Dan.

--
Daniel Dyer
http://www.dandyer.co.uk
 
Alun Harford





PostPosted: 2005-11-1 2:01:00 Top

java-programmer >> Encrypting Java Code "Mike" <email***@***.com> wrote in message
news:email***@***.com...
>
>
> I provide a Web service that is mostly JSP with a few java classes
> thrown in. I want to give my customers the ability to down load a
> subset of the service's functionality (JSPs) to run offline.
>
> How can I encript the code so that it cannot be reversed engineered?
> If it encripted, is there a performance hit?

You can't.
If you provide the information needed in order to run the code, you provide
the information needed in order to reverse engineer it.

Alun Harford


 
 
Benji





PostPosted: 2005-11-1 3:04:00 Top

java-programmer >> Encrypting Java Code Mike, while high on whiteboard markers, wrote:
> How can I encript the code so that it cannot be reversed engineered?

Don't worry about encrypting code. There's no really good reason for it.
For any sufficiently complex peice of code, it's easier for someone to
write it themselves than use a decompiler to reverse engineer it. If
you've actually put enough effort into it to worry about someone stealing
it, either it's too complex for them to be able to want to, or you put
too much effort into the code. ;-)

--
Of making better designs there is no end,
and much refactoring wearies the body.
 
 
Benji





PostPosted: 2005-11-1 6:02:00 Top

java-programmer >> Encrypting Java Code Mike, while high on whiteboard markers, wrote:
> How can I encript the code so that it cannot be reversed engineered?

Don't worry about encrypting code. There's no really good reason for it.
For any sufficiently complex peice of code, it's easier for someone to
write it themselves than use a decompiler to reverse engineer it. If
you've actually put enough effort into it to worry about someone stealing
it, either it's too complex for them to be able to want to, or you put
too much effort into the code. ;-)

Obfuscators should be a sufficient deturrent.

--
Of making better designs there is no end,
and much refactoring wearies the body.
 
 
Roedy Green





PostPosted: 2005-11-1 6:23:00 Top

java-programmer >> Encrypting Java Code On Mon, 31 Oct 2005 15:32:55 GMT, email***@***.com (Mike) wrote, quoted
or indirectly quoted someone who said :

>How can I encript the code so that it cannot be reversed engineered?
>If it encripted, is there a performance hit?

No, or otherwise how could the machine run it? The computer has to
know the key.

But you can make it more difficult to reverse engineer. see
http://mindprod.com/jgloss/obfuscator.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.