Protecting the jar files from being web access

I have a jnlp file which is put under tomcat webapps folder, say (\webapps\TEST\launch.jnlp), with the jar and lib files put in the subfolder (\webapps\TEST\folder1\*.jar AND \webapps\TEST\folder1\lib\*.jar).
My question is how can i prevent user from direct access to the jar files via typing http://www.someip.com/TEST/folder1/main.jar ? I tried the following methods but it seemed not working:
1. Change the folder permisson in \webapps\TEST\*.*, but when user type the above hyperlink they can still get the jar file
2. put the jar and related files under \WEB-INF\, but now this time running the launch.jnlp, it returns an error saying that it can't access/find the WEB-INF.
Is there any method? Or should I say, when you published jnlp to web, the related jar files are forced to be accessed by everyone.

Sounds easy to me: encrypt your xml, then instead of just storing your key as plain bytes do some reversable operations on it (xor masks, reversions, whatever you like), just do them in many different points (and classes) of your code, have some parts done by methods that actually check application is running under JWS with proper codebase, scramble it all, and suddently the whole stealing operation won't be worth the effort. Obviously you should have many private (and package protected) methods, seal packages and so on. Maybe, somehow, you can even use reflection to identify calling classes (not sure, never looked for anything similar).
What else? write down some c++ code into your own dll/JNI library and make it do something too, so they'll even need to decompile the dll. If you know first execution is always online you can send another xor key and store it with persistence service or write it down to windows registry. You can keep making it harder as much as you like, even just with silly code like
Math.ceil((new GregorianCalendar.getField(Calendar.YEAR)%2000)/1000)*((int)('c'-'a'))just to retrieve the number 2. If you distribute such code through many lines and methods, once you scramble it, most people will give up.
Bye.

Similar Messages

  • How to protect my jar file from being downloaded

    How can i protect my jar file from being downloaded by users by accessing it through the web site.
    Now everybody can just type the url www.mysite.com/applets/myApplet.jar
    And download it to his computer.
    I realize that anybody who really wants to download it he will get it anyway, but I want to make it harder.
    thanks in advance

    Your browser has to download the jar file if it's going to run the applet. That's applets work. The browser downloads the classes and then runs them locally.
    I suppose if you wanted to make something to make it difficult for users to explicitly download the jar, you could set some kind of permission flag when the HTML is page is rendered, and then unset it some amount of time (10 seconds?) later, and then only let the user download the jar when the flag is set. But this would be fragile and irritating and unhelpful. It would probably break more than you'd like and not prevent download very much (it wouldn't take long to figure out what was happening), and besides nobody is ever going to try to steal your code.

  • Protecting your jar file from been extracted

    Please i noticed that the java jar file of a software can easily be extracted to review the class files with winrar which allows just anyone to have access to your class file and decompile to get source codes, allowing pirating of the software. How can I lock the jar file to prevent extraction of my class files.

    1. why are you mocking others instead of answering the question ? some one wants to protect his jar file. the solution is simple.
    2. you can use google to search, here is result :
    http://stackoverflow.com/questions/1280702/protecting-java-jar-files-for-distribution
    http://stackoverflow.com/questions/9633455/how-to-protect-a-jar-file-from-being-decompiled
    http://www.thegeekstuff.com/2008/06/protect-your-java-code-from-reverse-engineering/
    http://answers.google.com/answers/threadview/id/431511.html
    http://stackoverflow.com/questions/1879061/how-to-protect-java-codes-against-decompiler
    http://viralpatel.net/blogs/2009/07/protect-java-code-decompilation-using-java-obfuscator.html
    http://www.coderanch.com/t/430716/java/java/Protect-class-file-not-decompile
    http://stackoverflow.com/questions/7324708/are-jar-file-insecure-what-can-done-apart-from-code-obfuscation
    http://stackoverflow.com/questions/3647255/how-do-i-copy-protect-my-java-application
    http://www.javaworld.com/javaworld/javatips/jw-javatip22.html
    http://stackoverflow.com/questions/12088/do-you-obfuscate-your-commercial-java-code
    3. it is true if you can use basic methods that EJP mentioned, there would be no need for obfuscators, nor native library use.
    but there are many situations that you can't do any of those methods.
    4. EJP claims that he probably is the one "who have had perhaps 40 times as long as you've had to think about it."
    here is the problem that made me use both obfuscation and native library :
    My company released a simple java library that scanned a document (directly from scanner or camera device).
    the documents were exam papers.
    Use some OCR techniques to convert image to text so some other application could calculate the score using it's api.
    For marketing purposes, the company needed to publish a 7-day trial version of this library.
    So, as you can see I'm eager to hear what you want to suggest.

  • What are the Jar files required,that for accessing the Type 4 Drivers.

    what are the Jar files required,that for accessing the Type 4 Drivers.
    Regards,

    Well it is Database Specific.
    Howevr there are few 3rd party .jar (Derby) which you can use it for accesing some standard databases.

  • How to strongly protect the step types from being modified by others?

    how to strongly protect the step types from being modified by others?

    Hi Jacky,
    You can make a property of a step uneditable by changing the property
    flags for the step.  First, you want to be able to view the hidden
    properties so that you can change the flags for these properties as
    well.  You do this by going to Configure>>Station Options
    and selecting the Preferences tab.  Check the box for Show Hidden
    Properties.  Once you have done this you can select the step type
    from the types palette.  In the window to the left, you can expand
    the tree for the type to see all the properties of that step. 
    Right click on the property that you do not want users to be able to
    edit, select Properties.  Then click the Advanced button. 
    Here you will see a list of the setable flags.  Check the box for
    PropFlag_NonEditable.  You can then do this for all the properties
    of the step that you do not want users to edit.
    Thanks,
    Caroline Tipton
    Data Management Product Manager
    National Instruments

  • How to keep my jar file from being downloaded?

    hi,
    problem:
    i turned a java app into an applet, put it on yahoo's server and was able to view the applet in a browser. but the html source tells where the applet's jar file is and so a user can download it. to prevent this, i put the jar file into a password protected folder. but this requires the user to enter a password before the applet is displayed.
    question:
    how can i use the jar file without protecting it with a password and keep it from being viewed or downloaded?
    this is a learning experience, the jar file simply prints the current time.

    If you want a client to run anything at all, it needs to be public. If people can't download it, their browsers can't as well.
    All you can do is run your code through an obfuscator to somewhat protect it from being copied.

  • Protecting Java jar files from decompiling.

    Hello,
    I need to distrubute ny Java application, I know there are tools to reengineer the java class file. How to Protect my class files from exploitation.
    Any suggestions.
    Thanks
    Shreenivasa

    1. Write a no-decompile clause into the licence.
    2. Make your product so expensive that no licensee will want anybody else to get one for nothing.
    3. Make your product so inexpensive that it would be simpler to buy it than reverse-engineer it.
    4. Bring out new versions of your product so rapidly or with such amazing new features in each release that the reverse-engineers can't keep up with you.
    5. Make a proper evaluation of the forgone revenue against the cost of all this engineering, that doesn't assume you would have sold a copy to every potential pirate, or that you can actually deter every potential pirate.
    In short it is a business problem. Not a technical problem.

  • How to protect the .class files from decompilers

    Hi all,
    I have developeed an application and I want it to be protected from the decompilers. The problem that I am facing now is that the .class files can be ripped by using the decompiling softwares.
    It will be great if any body cvan bail me out of this.
    Thanks
    kvmp

    Obfuscating your files is your best bet. This has been discussed to death, both here and on every other Java-related discussion site and newsgroup since about 1996; a Google search on "Java obfuscation" should help.
    You can also look here for an overview:
    http://mindprod.com/jglossobfuscator.html#OBFUSCATOR
    Grant

  • Protecting swf files from being decompiled

    At the end of the day, our flex apps are deployed as swf
    files which have the potential to be decomplied and thereby our
    intellectual properties lost. There are tools in the market which
    claim to secure the swf files from being decompiled. Are these
    tools live up to their claims? Is it worthwhile to spend money on
    these tools? Would the protected swf become harder to deployed? Any
    good products already available in this line? Please point out
    some. Thx.

    Most of the tools I have seen are geared towards extracting
    resources from swf's. I use one myself (eltima.com) for
    "harvesting" manufacturers content for my motorcycle dealers. They
    are authorized to use this content, but finding someone at Yamaha
    of Kawasaki or any of the majors who even knows where to find these
    resources is next to impossible. I have also used it to learn from
    by viewing scripts, but as you say, at the end of the day, I think
    the concepts and best practices are about the only thing worth
    taking away from others efforts, not the code.
    Unlocking a protected file can be done as well and I remember
    using a product over a year ago to get at the scripts within an swf
    (I wanted the URL's that pointed to media - it was legal for me to
    do this). It ran from the command line and output the scripts.
    There aren't too many of these types of programs to be found, but
    they exist.
    My personal opinion is that it's not worth the effort. My
    java classes can be decompiled and if someone wants to go to that
    trouble, more power to them. To my knowledge, there isn't anything
    out there yet that is perfect for backwards engineering an swf into
    an MXML file, but a competitor of FLASH Decompiler says that they
    can decompile Adobe 9 PLAYER swf's. For what it's worth, I plan on
    posting the majority of my code on my flexdev.org site once I get
    it established.
    For people who make components for sale, this could be an
    issue of stolen revenue if the decompilers get sophisticated enough
    to reverse engineer the swc into a usable MXML file. I would be
    against anyone who stole code for this purpose, for sure.

  • How to protect the class files inside jar file.

    Hi Group,
    pls help me.
    my need is i created a executable jar file with certain classes.
    and i'm supposed to send it to my client.
    but if the client needs he can extract the class files from the jar and with the
    help of some decompilers he can convert class file to .java source code and read the whole
    stuff.
    how can i protect my jar file from these.
    is there any security mechanism for that
    pls help me.
    Regards,
    Ranjith.M

    In order to protect my jar file I tried the jar signer technology but it only protects the jar from modification so I need to know how to protect jar file from decoding of the contents inside.

  • Protect DLL Files from being deleted or unregistered

    I am looking for a way to protect a DLL file from being deleted or unregistered.
    My users have an application that uses the same DLL files as another application. This is in a test environment, so when they are uninstalled they step on each other by deleting or un-registering the DLLs.
    Any ideas?

    Hi,
    These apps are designed to delete the DLL file in uninstallation process. You can test to Deny the Delete permission on the DLL file as a test but it may cause a new issue that application think they failed to uninstall itself clearly as the DLL file cannot
    be deleted. Just have a try on Deny Delete permission in NTFS security. 
    If you have any feedback on our support, please send to [email protected]

  • Can't run JavaFX app as a jar file from command line

    I'm trying to build a JavaFX app from scratch (that is, by including the jar file from the JavaFX SDK rather than by using the special JavaFX project type from NetBeans). It runs fine in NetBeans. However, when I try to launch it as a jar file from the command line (using "java -jar dist\TestApp") I get the following. Has anybody seen this before, and if so how can I fix it?:
    *** Fallback to Prism SW pipeline
    Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLink
    Error: Can't load library: C:\dev\TestApp\dist\bin\mat.dll
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:
    289)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:68)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
    pl.java:145)
    at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
    27)
    at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:97)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\dev\RedactionT
    oolPrototype\RedactionToolPrototype.Core\dist\bin\mat.dll
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoad
    er.java:155)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoad
    er.java:85)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:
    30)
    at com.sun.glass.ui.Application$1.run(Application.java:28)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:26)
    at com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:33)
    at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatform
    Factory.java:20)
    at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatform
    Factory.java:17)
    at com.sun.glass.ui.Application.Run(Application.java:51)
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:
    279)
    ... 5 more

    Unsatisfied link means that Java is trying to access a native library, but it cannot be found. As to why this error is being thrown, here is my guess:
    If you open up one of the sample jars with a zip viewer, you will see that the Manifest file has the following entries:
    >
    Manifest-Version: 1.0
    JavaFX-Version: 2.0
    implementation-vendor: Oracle
    implementation-title: BrickBreaker
    implementation-version: 1.0
    JavaFX-Application-Class: brickbreaker.Main
    Created-By: JavaFX Packager
    Main-Class: com/javafx/main/Main
    >
    In other words, a JavaFX project works a bit differently than a normal Java project. com/javafx/main/Main is used as the Main class and your "Main" class is called later.
    If you are trying to build this from a normal Java project, then com/javafx/main/Main will not be created and it will call your Main class right away. Thus, whatever setup is needed to run JavaFX will not occur.

  • Moving all jar files from our applcation to applib folder on server

    Hi,
    In our project we have three web applications bundled into a EAR file,to reduce the upload size we had a plan of moving all the jar files from WEB-INF/lib to the applib folder in the standalone server, but after moving i tried to run the application I get the following error,can someone help on this?
    login: JspServlet: unable to dispatch to requested page: Exception:oracle.jsp.parse.JspParseException: /jsp
    /common/page1.jsp: Line # 5, <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>

    Hi,
    appears that it cannot find teh tag library. However, I think the right way of sharing libraries is to read into the topic of shared library support of the server you are working with
    Frank

  • How do you protect the .swf files ?

    Do you protect your flex files from being decompiled?
    Is there any flex techiques for more security? What about HP SWFScan?
    All opinions wellcome....

    There are several different options... each with varying degrees of security, technical complexity, and cost. Entry level protection usually involves some kind of obfuscation which makes your code difficult to read / re-use - but not impossible. If this isn't enough you'll want to look into swf encryption... which raises the bar significantly. The last item worth mentioning is loading a swf from a protected source. You could also improve this last approach by loading your swf from _inside_ another swf. Here are some links to get your started.
    Amayeta SWF Encrypt 6.0
    http://www.amayeta.com/
    irrFuscator ActionScript 3 Obfuscator
    http://www.ambiera.com/irrfuscator/index.html
    Security Through Obscurity: can you hide swf files on your website?
    http://www.quilix.com/node/31
    Cheers,
    Rick Winscot
    www.quilix.com

  • Problem when downloading the JAR file

    I'm just install JRE and testing my first applet application. I'm facing the problem that I can not download the JAR file from my localhost computer.
    I've enable cache in Java Control Panel and running my applet. Normally, it will download the jar file from my localhost and save it to the cache directory of Java. And then finding all classes neccessary to run my applet in the JAR file.
    But I discover that I can not download the JAR file and save to my computer. I try to put the URL to download this JAR file (http://localhost/myjar.jar) in my web address, it start to download this file properly. But when open it with WINRAR, I got an error that the file "Unexpected end of file".
    I try to put this file from onther computer in my LAN. And use the URL to download it. This time I can open the JAR file with WINRAR althrought the file size is the same
    Anyone know why there are some errors when download from my localhost? Thanks in advance for any help!!!

    Yeah everything matches up!
    Could it have something to do with the string encoding? I created the file in ANSI format? Would this have an effect on it?

Maybe you are looking for