views:

256

answers:

5

Hello.

I want to sell my Java application using PayPal. When a payment is received, the customer is mailed a one-time download link to my application.

My question is, how do I prevent people from sending the .jar file to their friends/uploading it on the internet?

Obviously I need some kind of check in the application which only allows it to run on one computer. And that's another problem, I don't want a customer to have limitations on one computer, they should be able to run it at home and work etc.

Maybe some kind of cd-key would do the trick? Is there any cd-key resources for Java out there? Or should i build my own algorithm? Here comes yet another problem, reverse engineering..

Please help me solve this :)

+1  A: 

You must implement licensing capabilities.

Here is one interesting resource as a starter: http://members.chello.at/stefan-schneider/JavaLicenseKit.html

Pierre 303
+6  A: 

The most common way to handle this is: customer gives you money, you generate a unique unlock key and provide that to the customer. The key should be a valid unlock key, and it should encode identification information about the user. Customer uses that key to install on as many of their computers as they like, or is allowed by the license.

Don't worry about reverse-engineering. Your product, if it's at all popular, will be pirated - you'll find unlock keys online if you look hard enough. If you like, you can take that as a compliment - someone liked your software enough to steal it. Cold comfort, I know, but the alternative is to get in an arms race with the pirates, and you won't win that. In the end, a few percent of the population will steal software, and you can't do much about that. You can use the key's identification information, if your scheme is strong enough, to trace who released the key in the first place.

Michael Petrotta
I'm going to need an online lookup service for the keys right?
cragiz
+1  A: 
Mondain
It's easier to crack a version with a trial period. You already have the full version, all you need is to fake the time.
Colin Hebert
That goes back to several of my points - keeping honest people honest, obfuscation, and accepting that you will not defeat piracy.
Mondain
@Mondain - not entirely true. In some cases, badly implemented DRM will prevent honest people from doing things that they are entitled to do (by law), and cause them to break your DRM. (Or throw your software out of the nearest window, and never do business with you again!)
Stephen C
Very true Stephen, good point
Mondain
A: 

In my opinion, if you don't know exactly how you will protect your source code efficiently, then don't start trying to hash something together yourself based on hardware. It will be too easy to break, and most likely just annoy your customers.

I would sugest you have a look at how Atlassian does this. They happen to sell Java software, and apparently do quite well. http://www.atlassian.com/ Try downloading e.g. JIRA and play with an installation. This will give you a good idea of how their licensing scheme works, and what users can reasonably expect from professional software.

Thorbjørn Ravn Andersen
A: 

Protecting your IP and protecting your licenses from abuse are two independent issues. Obfuscation and encryption are solutions for the first, and there are a number of tools out there.

For protecting your licenses, why re-invent the wheel when the problem has already been solved for you? Commercial tools such as the EasyLicenser license manager are multi-platform Java and protect against such attacks as copying to other machines, rolling back the system clock to cheat on trial licenses, attempting to spoof the license-checking code etc.

Dominic

Dominic