Encrypting Java Code

Discussion in 'Java' started by Mike, Oct 31, 2005.

  1. Mike

    Mike Guest

    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
     
    Mike, Oct 31, 2005
    #1
    1. Advertising

  2. Mike

    Daniel Dyer Guest

    On Mon, 31 Oct 2005 15:32:55 -0000, Mike <> 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
     
    Daniel Dyer, Oct 31, 2005
    #2
    1. Advertising

  3. Mike

    Alun Harford Guest

    "Mike" <> wrote in message
    news:...
    >
    >
    > 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
     
    Alun Harford, Oct 31, 2005
    #3
  4. Mike

    Benji Guest

    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, Oct 31, 2005
    #4
  5. Mike

    Benji Guest

    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.
     
    Benji, Oct 31, 2005
    #5
  6. Mike

    Roedy Green Guest

    On Mon, 31 Oct 2005 15:32:55 GMT, (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.
     
    Roedy Green, Oct 31, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mohammad Samara

    Encrypting the source code

    Mohammad Samara, Dec 5, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    387
    Arun Ganesh [Microsoft MVP]
    Dec 5, 2003
  2. Andy Grove

    Encrypting passwords using Java

    Andy Grove, Feb 12, 2004, in forum: Java
    Replies:
    8
    Views:
    2,150
    Joona I Palaste
    Feb 14, 2004
  3. Mohammad Samara

    Encrypting the source code

    Mohammad Samara, Dec 5, 2003, in forum: ASP .Net Security
    Replies:
    5
    Views:
    199
    Jim Cheshire [MSFT]
    Dec 9, 2003
  4. Keith G Hicks
    Replies:
    0
    Views:
    150
    Keith G Hicks
    Apr 5, 2008
  5. Jason Davis

    Encrypting JS Code on wscript

    Jason Davis, Sep 13, 2003, in forum: Javascript
    Replies:
    1
    Views:
    107
    Ira Baxter
    Sep 14, 2003
Loading...

Share This Page