Can I somehow protect a source available (you can see the source, but you don't have rights to use it) application against piracy? Is it even theoretically possible?

Not all of the application has to be available, "security module" or how to call it can be closed source, no licensing issue here.

closed as too broad by ratchet freak, Michael Kohne, user53019, gnat, Robert Harvey Sep 17 '14 at 20:03


  • 2
    Some companies make "trivial" parts of their apps open source - like the GUI etc, while making the core - closed and proprietary (and possibly residing on a server). But if you're allowing any and all source to be visible to the outside, then your best bet is legal protection, not programmatic. – Ordous Sep 17 '14 at 15:40
  • @Ordous I thought so :/ I'll guess I'll have to relay on legal system :/ would you be so kind to write this as an answer, so if no one comes in with some idea I could accept your comment as correct answer? – graywolf Sep 17 '14 at 15:45
  • 2
    When you publish the code but allow nobody to copy it, it is called source available, not open source. – Philipp Sep 17 '14 at 16:42
  • 1
    yes, you can. You can do it by using a custom language for which nobody but you has the compiler. Which of course means writing the compiler first and NOT disclosing that source. – jwenting Sep 18 '14 at 6:27
  • 2
    @BartvanIngenSchenau sure, but he was explicitly asking about preventing people reusing his source, not decompiling his executables. Another way to get around custom languages is reverse engineering the algorithms in the code and rewriting it all in a language you can compile... – jwenting Sep 18 '14 at 7:29

Can I somehow protect any application against piracy? Is it even theoretically possible?

No, and it's a complete waste of time and effort to even try. When Microsoft's new OSes have cracked versions available before release day, and they put more R&D money into just that one feature than you'll ever see in your whole life, that should give you a bit of perspective.

Making the source available just makes it easier to copy, but either way, there's no way to keep a program you distribute a copy of to another person from being copied and distributed even further. The basic problem is that the computer needs to read it in order to execute it, and if the computer can, so can someone who knows how computers work.

It's been called "the fundamental question of cryptography:" Alice wants to send a letter to Bob, without Charlie being able to read it even if he should get his hands on it. The problem in this scenario is that Bob and Charlie are the same person.

So don't even worry about trying; it's a waste of time and money. As Ordous said, your protection should be legal in nature, not technical. And to add to that, the best protection against piracy is using human nature and basic capitalism to your advantage. Generally speaking, people want to be good, and see themselves as good. So if you follow fundamental market theory, and offer a good product at a price that is less than what they perceive its value to them to be, they will be willing to pay for it even if an illegal alternative exists. Piracy is almost always a symptom of excessive pricing or poor attention to the needs of the customers.

  • 1
    especially like this part: " Piracy is almost always a symptom of excessive pricing or poor attention to the needs of the customers." – graywolf Sep 17 '14 at 19:42
  • @Paladin not really. There's a lot of people who'll pirate freeware, even buy pirated copies of freeware. Seen it happen a lot. – jwenting Sep 18 '14 at 6:49
  • @jwenting: There is a small percentage of people who'll do that; the vast majority of people are generally honest. Unfortunately, a small percentage of a few billion people is still a rather large number. – Mason Wheeler Sep 18 '14 at 12:48
  • @MasonWheeler more than a small percentage, sadly, of people still hold to "if it's on the internet it should be free", stealing left and right. – jwenting Sep 18 '14 at 12:49
  • @jwenting: First, if you're going to make an assertion that directly contradicts statistical evidence, you're going to need some bigger evidence to back it up. Second, using the S word in the context of piracy completely destroys the credibility of your argument. Theft requires loss, which copying, legal or illegal, does not cause. – Mason Wheeler Sep 18 '14 at 14:11

As per comments:

If some or all of your sources have gone public - it's not the end of the world. Some companies operate on a semi-open software basis, where parts of the software are open, and some are proprietary.

Your main protection should be legal. Any software will be pirated, independent of the amount of protection on source code, if it is deemed worthwhile. It's copyright and patents that prevent other companies from using it. Private users may present more of a challenge, depending on the nature of the software you are making.
