Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java in General and the fly likes encrypt codes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "encrypt codes" Watch "encrypt codes" New topic

encrypt codes

lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
This there any way to encrypt the jsp coding and java class? so that the users cant take and re-use.
for the java class, it must not allow decompiler to decompile the file.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
no. If the computer can execute it, it can bring it back to some human readable form.
That's not just true for JSPs and Java classes, but for everything.

You could have gotten your answer a lot quicker by using some search engines, as here alone it's answered on average at least once a month (and periodically once a week or more often).

Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Yes , this might be possible to encrypt your .class files , but the classloader that would be loading those files should again decrypt the codes.I do not feel that is very useful as you can always decompile the classloaders code to find as how the decrytion of the classes being done.

you can try using any Obfuscator.


Rahul Bhattacharjee
LinkedIn - Blog
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The code of JSP pages is never available to the user, as it resides on the server only (where it is presumably safe). Or are you talking about a scenario where the customer is provided with a complete deployable web app?
I agree. Here's the link:
subject: encrypt codes
It's not a secret anymore!