8 Replies Latest reply: Feb 10, 2011 6:15 AM by jduprez RSS

    How do i protect my jar file

    838497
      Hi,

      Give me some to how do i protech the JAR file.

      even i wont unzip the jar file..

      Edited by: user11001335 on Feb 10, 2011 1:13 AM
        • 1. Re: How do i protect my jar file
          jduprez
          I'm not sure I understand your question.

          Do you want to protect it as "not allowing untrusted code to be added to the jar"? Then read the Java tutorial chapter about signing jars: http://download.oracle.com/javase/tutorial/security/toolsign/index.html

          Do you want to protect it such as "not allowing anyone else but me to see its contents"? Then for SE and EE applications at least, forget about it, at the end of the day a JVM will need to read its contents to execute it.

          Do you want to protect it such as "not allowing anyone to see my code"? Then forget about it as well, as Java is known to be decompilable, this can only be made more difficult by using "obfuscators", but not be rendered impossible for an attacker with that goal in mind.
          • 2. Re: How do i protect my jar file
            gimbal2
            Look up the phrase "software as a service" to know how to protect your code/files with any kind of success.
            • 3. Re: How do i protect my jar file
              838497
              I need concept how it will work...! once i done jar file, i dont want to view the .class file..

              anyone give some suggestion.. best i can understood this concepts..
              • 4. Re: How do i protect my jar file
                java4ever
                user11001335 wrote:
                I need concept how it will work...! once i done jar file, i dont want to view the .class file..
                Not possible the jar will always have the class files.

                anyone give some suggestion.. best i can understood this concepts..
                Why such heavy security is required...???
                • 5. Re: How do i protect my jar file
                  jwenting
                  there is no concept.
                  If you can't see the classfiles, neither can a JVM, which means the jar file is useless as it can't be used to load classes from.
                  • 6. Re: How do i protect my jar file
                    Kayaman
                    RainaV wrote:
                    Why such heavy security is required...???
                    He just programmed (or will soon program) the most fantastic thing ever in Java and wants to protect his code.
                    • 7. Re: How do i protect my jar file
                      tschodt
                      user11001335 wrote:
                      I need concept how it will work...! once i done jar file, i dont want to view the .class file..

                      anyone give some suggestion.. best i can understood this concepts..
                      Deploy the jar on your own hardware where you have control over who can access files,
                      give your users a thin client that connects to your server to interact with the business logic in your jar.
                      • 8. Re: How do i protect my jar file
                        jduprez
                        I need concept how it will work...! once i done jar file, i dont want to view the .class file..
                        Can you clarify your requirement? I don't understand what this means (or, the little I understand is, as described at least twice above, inconsistent with the idea of running the application contained in the jar file).
                        anyone give some suggestion.. best i can understood this concepts..
                        You had already been given 3 suggestions at that point. More replies have come, essentially stating either the same thing in more details, or confirming that what we guess you mean is impossible. It's useless to pile more guesswork until you have
                        1) read the existing replies
                        2) clarified your requirements