tags:

views:

160

answers:

3

I have made a java project and want to deliver it to a client but I don't want to deliver it as a jar file as the client can see the source code easily by unpacking the jar file.

How can I pack my java project so client cannot look at the source code or cannot change the source code?

One more thing, Can I integrate a key functionality so that client can only access that software by first registering it with the key provided by me?

Second, can I integrate another functionality through which the software can run only on a single machine through that key?

Remember, the software should still have the cross-platform functionality and if it is not possible then how can I made it for Debian Linux as I have made it on Windows.

+2  A: 

Obfuscators

adatapost
+2  A: 

To your first point. Why not only jar up the class files? These are in byte code so the client will not be able to view the source.

As to providing a key. This can be done and there are libraries that allow this, but be careful as , to my knowledge at least, there has yet to be developed a DRM system that hasn't been cracked. and most users do not like software restricting what they can do. The same point applies to your third question.

Jamie Lewis
Class files can easily be decompiled with Decompilers available freeware also. I like the obfuscation of the code suggested by "adatapost."Can you explain me in detail which libraries are there to provide a key functionality.
Yatendra Goel
Obfuscated code can also be easily reverse engineered if people really wanted it to. At the end of the day, unless you maintain control of the program i.e. through a network interface (be it web or otherwise) you cannot guarantee the client will not interfere with it. And even then....As for libraries, if you really want one...have a look at http://www.javalicensemanager.com/
Jamie Lewis
+1  A: 

There are some simple things you can do to make it a bit difficult for a client to get hold of your source code and to enforce per-host (etcetera) licensing. For example, obfuscators make it harder to reverse engineer bytecode files, and license managers support a range of restrictions based on the "keys" that you generate and supply.

The problem is that none of these protect you against someone who is determined to subvert the restrictions are trying to impose. For example, no obfuscator can prevent someone figuring out where your code calls a license manager, and once they know that they can modify the code to subvert any license checking.

Short of locking down the entire execution platform (e.g. turning of the client's ability to run debuggers, read physical devices and so on), there is nothing you can do about this.

A more viable strategy is to include appropriate protections in the software license that you require the client to sign. And accept that there is a risk that you may need to take clients to court if they willfully violate the license agreement.

Stephen C
Very helpful answer. Thanks for that.As something is better than nothing, so can you tell me in more detail about how to use license managers.
Yatendra Goel