-2

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.

gnat
  • 21,442
  • 29
  • 112
  • 288
graywolf
  • 165
  • 1
  • 9
  • 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
  • http://meta.programmers.stackexchange.com/questions/6483/why-was-my-question-closed-or-down-voted/6490#6490 – gnat Sep 17 '14 at 18:19
  • quite an outright duplicate of [How can software be protected from piracy?](http://programmers.stackexchange.com/questions/46434/how-can-software-be-protected-from-piracy) – gnat Sep 17 '14 at 19:05
  • @gnat My question specifically asks how to protect `source available` application.. I don't think it's a duplicate – graywolf Sep 17 '14 at 19:41
  • http://meta.stackexchange.com/a/194495/165773 – gnat Sep 17 '14 at 20:09
  • 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 06:27
  • @jwenting yeah I'm not doing that :D but your idea is rock solid, it's just that it requires lot of work :/ – graywolf Sep 18 '14 at 06:44
  • @Paladin it is, it's also the only way to prevent people just loading your code into a compiler and making their own executables, if you're assuming they're intending to violate their licenses of course. – jwenting Sep 18 '14 at 06:45
  • @jwenting: Even a custom language won't help all the time. It is always possible to decompile the application into a different, better known language. – Bart van Ingen Schenau Sep 18 '14 at 07:22
  • 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 07:29

2 Answers2

8

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.

Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
  • 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 06:49
  • @jwenting: There is a small percentage of people who'll do that; [the vast majority of people are generally honest](http://www.nytimes.com/2004/06/06/magazine/what-the-bagel-man-saw.html). 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.](http://www.youtube.com/watch?v=IeTybKL1pM4) – Mason Wheeler Sep 18 '14 at 14:11
3

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.

Ordous
  • 1,917
  • 13
  • 12