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 - 31 Oct 2005 17:09 GMT
> 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
[quoted text clipped - 4 lines]
>
> 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.

Signature
Daniel Dyer
http://www.dandyer.co.uk
Alun Harford - 31 Oct 2005 19:01 GMT
> 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 - 31 Oct 2005 20:03 GMT
> 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. ;-)

Signature
Of making better designs there is no end,
and much refactoring wearies the body.
Benji - 31 Oct 2005 23:01 GMT
> 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.

Signature
Of making better designs there is no end,
and much refactoring wearies the body.
Roedy Green - 31 Oct 2005 23:23 GMT
>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

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.