When selling software online what's the most suitable/secure way to provide activation in order to get rid of pirates copies of the software? Is there any well-known software for this purpose?

  • 1
    this is too broad to be answered. – alfa64 May 21 '12 at 0:23
  • 2
    Somebody sufficiently determined not to pay for your product will find a way to circumvent any DRM you can come up with eventually, this effectively makes *make the software unpiratble" an unrealistic non-functional requirement. You're better off setting a level of piracy that's acceptable and making that your NFR. Also, legitimate customers HATE DRM! If you make your software resistant to piracy only to make it barely usable to the people who did pay for it you'll have pretty much scored an own goal. – GordonM May 21 '12 at 7:09
  • Traditional pirates (seven seas and rum and stuff) were discouraged by organised Navy patrol vessels, borders and customs and faster merchant ships. Perhaps there's a lesson we can learn there, somewhere. – oliver-clare May 21 '12 at 8:48

You pretty much can't. Any pirate group who wants to crack your software will, for fun, and then give it to everyone else and there is nothing you can do. Microsoft can't keep Windows off torrent sites, and the UK government can't stop people visiting The Pirate Bay.

There's a reason that the new wisdom in many creative circles is to accept piracy and use it for free marketing- for example, release your old books for free to generate hype for a new one, which Neil Gaiman did to great success, and it's because there are no technical solutions to the problem of piracy.

Services like Steam which offer high-quality services are growing at a massive rate and still raking in embarassing amounts of money, long after everyone else said the PC market was dead due to piracy. Now it's the most vibrant market of games there is.

Piracy is not a technical problem, and there's no code you can write to solve it. It's a service problem. Those industries which offer strong digital services like games and books are doing fine, regardless of piracy. Those which are stuck in the 70s, like films, are not.

For example, can you download a film in full HD, watch and take it where and whenever you want, and re-download it to view whenever you want? That's service, but the MPAA don't offer it. So is it really a surprise that would-be filmgoers turn to torrent sites instead?

  • 1
    Just want to add that while you can't prevent it, you can make it harder and "feel" more unethical. It's a lot easier for people to steal Textpad which just gently reminds you to pay than software that demands a license key. – Jeanne Boyarsky May 21 '12 at 3:55
  • 5
    @Jeanne: The version you download from The Pirate Bay won't ask you for a licence key. – DeadMG May 21 '12 at 4:07
  • 1
    @DeadMG proving Jeanne Boyarsky's point exactly. I agree with what you say, though. Piracy is a service problem. I know plenty of guys who have paid top dollar for a chip reader for their CPUs so that they can make binary dumps of groups of instructions running on DRM protected programs just so that they can crack them, themselves. And they're only doing it, as you say, for fun. – Jamie Taylor May 21 '12 at 8:37
  • 1
    "Those industries which offer strong digital services like games and books are doing fine, regardless of piracy. Those which are stuck in the 70s, like films, are not." - What? Do you have any evidence to support your claims that the films industry is stuck in the 70s, or that the films industry is doing badly, or that the books and games industry can disregard pirates? – oliver-clare May 21 '12 at 8:52
  • 2
    @LordScree: When you want to watch a film, can you download that film (for a price) in HD, take it with you wherever you want and watch it wherever you want, re-download it whenever you want, on release day? That's what you can do with books and games. Is it any wonder that people pirate films? Their only options to obtain them legally are horrifically inconvenient and expensive, without the price of the ticket. And cheap, DRM-free games are making frankly embarrassing amounts of money right now- even pay what you want games. Films don't match that- only the biggest blockbusters make money. – DeadMG May 21 '12 at 9:03

Face it: you will be unable to get rid of all pirated copies of your software.

Any anti-piracy system can be worked around. A sufficiently interested warez person/group could write a crack which bypasses the activation-related parts in your software. You could write a counterattack to this, and then it becomes a catch: pirates vs. your implementations of anti-piracy methods.

The most common systems uses license keys + validating them against a remote server, which provides little hassle to legitimate users. This can also be used to add value: only legitimate users will have access to some features - pirated copies can go into a crippled mode.

However, even this has its problems: what if your license servers go down for any reason, or your company goes bankrupt? So you will have to understand and learn to live with those limitations.

Since you're selling your software online, you could also use a license file which is encrypted and validated against a server. Optionally, adding some sort of machine identification (e.g. by hardware characteristics), to avoid people copying the same license file to different machines.

This Stack Overflow question can be interesting reading: I've found my software as cracked download on Internet, what to do?, and this Slashdot post: Ask Slashdot: Copy Protection Advice For ~$10k Software? is relevant too.


License keys by far. There are some open source license key generators - Google lists a few right not top for that search. Which you choose depends on what language you are using.

  • 3
    +1 - license keys help keep honest people honest. In particular they work well in products sold to businesses in the United States. A U.S. business might install an unprotected copy of a commerical program, but they are much less likely to take the affirmative step of actually cracking your keys. – Jim In Texas May 21 '12 at 3:16

If there is an online service that is an integral part of your software, then that can be sufficiently secured.

However don't be tempted to add some "token online service" just for the sake of using it as copy-protection: that will be worked around.

In fact, the online service would be the real product, with the actual software being just a way to access it (so you might as well give the software itself away).

Of course this approach has all the usual constraints of requiring a permanent internet connection (don't be fooled, even in our modern world, that's still a deal-breaker sometimes).


As already stated, there is no way to fully protect desktop software.

However, not all is lost. The only real way to protect your software is to have significant part of the software working in SaaS model, with the desktop being just a client, useless without the back-end. This of course means, that users have to be on-line to use it, but nowadays, that's not a huge issue.

  • That depends. There are many situations where you can get stuck without an internet connection. It's a pain in the ass if you can't work without the connection. But I agree that it's the safest way for piracy protection. Yet, I will never buy a software using this, if I have the chance to avoid it! If I have to use it and the softwares servers are down, I'll get really mad at the company selling it. If there's room for a charge, I'd probably go for it... – Skalli May 21 '12 at 8:53
  • Well, I feel that moving software to cloud is inevitable anyhow. Of course, off-line mode can be added, but if it's going to be fully functional, you're back to square one -- anything on desktop can be pirated. – vartec May 21 '12 at 8:57
  • It may be more work, but looking at the blackbox of SaaS the service can be reverse engineered. Writing an own implemention of the services is, depending on the size of the service, possible. If the whole software runs in the cloud this is of course not an option. For companies which have the need for security critical applications using software in the cloud is (probably) not an option. – Skalli May 21 '12 at 9:01
  • But then these companies will be willing to pay big bucks for non-public-cloud version, and unlikely to use pirated versions nor to pirate one they bought. – vartec May 21 '12 at 9:26
  • That is indeed true... ;) Yet it fits when you offer a relative small service. I'm not sure about big companies, but what I've seen in smaller companies when it comes to buying licences was frustrating, even companies who develop software themselves pirate software which I find ironic and stupid. From what I've experienced it's worth making a good product and sell it with a soft copyright protection, many costumers will reward it. – Skalli May 21 '12 at 9:38

If you're really dead set on preventing piracy there's one hardware-dongle based system that has never been fully cracked as far as I have been able to ascertain: WIBU CodeMeter. That they haven't been cracked is of course out of their own press releases (Hacker Contest - WIBU still uncracked) so take the claim with a grain of salt, but at least they are confident enough to hold these contests!

This system is based around hardware encryption on the key itself and all kinds of tamper-proofing in the hardware and software. They regularly update their system as well.

Logistically shipping hardware keys can be a pretty big overhead, and the keys and licenses are not free. You pay for the hardware, and you pay a (small) fee per license activation.

They do offer a software-only version (CodeMeterACT) but this is less secure, by their own admission.


Anyone sufficiently motivated will be able to break you anti-piracy measures. No matter what encryption validation scheme you use at the end of the day you must have a clean executable in memory. And this can be used as the basis for defeating your scheme.

You are liable to lose more sales through honest customers disliking whatever hoops your anti-piracy scheme makes them jump through, than, you will through illegal copying.

Not the answer you're looking for? Browse other questions tagged or ask your own question.