LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Make a closed-source C Program for Windows, Mac and Linux/Unix. (http://www.linuxquestions.org/questions/programming-9/make-a-closed-source-c-program-for-windows-mac-and-linux-unix-4175427174/)

suttiwit 09-14-2012 12:40 AM

Make a closed-source C Program for Windows, Mac and Linux/Unix.
 
I am helping my family doing some bisuness, and the software is for sale. But, I will show some parts of the program to the forums. The question is, how do I hide the source code?

So people don't copy and distribute it for free.
This is the first time for me making a closed-source software.

AnanthaP 09-14-2012 01:36 AM

If it is pure html or html with embedded javascript then what you say may be true.

However if it is server based, then what gets rendered in the browser is only the result. ie. source code isn't shown. Likewise for javascript in "included" files (<SCRIPT LANGUAGE=javascript SRC="<yoursourcegoeshere>")

If the project is not web based, then whats the problem?

OK

NevemTeve 09-14-2012 03:09 AM

Relax, nobody will steal your code.

zhjim 09-14-2012 04:07 AM

But they may reverse engineer it and steal your soul.

No honestly if you provide only the compiled program there is a low chance anyone "stealing" the source code.
But like with everything if you give something to someone you never can be sure what he will do with it. And can not be prevented with any means. Beside locking him up and erasing his memory and feelings afterwards so he can't even remember a single bit *pun intended*.

But I would not think about such malice there are more nice people than evil people. Just make a decent price and people will refrain from illegal stuff like sharing or distributing it through dark channel.

sundialsvcs 09-14-2012 08:06 AM

Since I do this sort of thing professionally, I can advise ... and I'm not going to say perhaps what you expect from someone who is posting "here."

What you would need to be able to do is to build installers for each environment ... appropriate to each environment ... and to thoroughly validate and test your program in all of them, and to maintain that for every customer going forward. ("Virtual machines," run by purchased software such as VMWare on whatever host-environment most suits you, and externally connected hard-drives, are ideal for this, because you do need isolated environments but you don't need a room full of computers.)

Important: This represents an ongoing expense-item that you will need to factor into the ongoing cost of your product. You need to sell the product with mandatory periodic maintenance fees, which you should handle by means of, say, a PayPal "subscription" that collects money several times each year. You need to thoroughly plan-out the maintenance and support equation.

Only the Linux environments can be expected to support "open-source" installations. Neither OS/X nor certainly Windows users customarily have any sort of language-compiler on their systems. Furthermore, even the preponderance of Linux users really don't care whether the product that runs their family business is "open source" or not: they want a drop-dead easy, guaranteed-to-work installation process, and a toll-free telephone number (hint: use Skype instead) to call if it does not.

Environments can be subtle. Both Apple and Microsoft right now are making rather big changes to their systems, partly to steer them in the direction of portable devices which they fear are taking hold. Those differences can be problematic for you.

Seriously consider whether you really want to support all three environments at once. Poll your potential customers to find out. Do an inventory of the competition and see where they have chosen to concentrate their efforts. People who really like your product just might go and purchase "whatever computer you tell them to" just to use your product on it. The name of the game is profitability, and "dissipation" is a good way to lose those profits. In other words, move in the directions that your paying clients tell you to.

A business-plan will be very important at these early stages, for your family (your "internal clients") and for you ("the IT manager"). Really test those waters, really work-out the thing on paper, "discover every thing that might possibly bite you in the asterisk before it has a chance to do so, so that it never does." Engage every business stakeholder: you, your family, maybe some potential customers. "Forewarned is forearmed."

suttiwit 09-14-2012 08:22 AM

i just found out. I think I will use base64 to encode and the installer will decode. thanks.

zhjim 09-14-2012 08:50 AM

base64 encoding is in now way a secure encryption. (Nearly) Every programming language holds a function to decode that.

wpeckham 09-14-2012 01:27 PM

C, really using C?
 
If you are programming in anything that compiles down to an executable (or executable and specific libs) you simply hide the source and only allow installation of your executable and libs. This easily gives the end users access ONLY to your product, but not to the source code.

While it is possible to reverse-engineer software from the executable, it is not something most people could handle.

If you share a machine with some of these people, consider doing your development work in a TRUECRYPT folder so that all of your source will be encrypted and only available to someone who knows your password. And do NOT share that password!

ntubski 09-14-2012 04:10 PM

Quote:

Originally Posted by AnanthaP (Post 4779974)
However if it is server based, then what gets rendered in the browser is only the result. ie. source code isn't shown. Likewise for javascript in "included" files (<SCRIPT LANGUAGE=javascript SRC="<yoursourcegoeshere>")

Not true for the javascript case: the code is executed on the browser so the code must be downloadable by the browser.

Quote:

Originally Posted by suttiwit
I think I will use base64 to encode and the installer will decode.

huh? :confused:

AnanthaP 09-15-2012 07:15 PM

Quote:

Quote:
Originally Posted by AnanthaP
However if it is server based, then what gets rendered in the browser is only the result. ie. source code isn't shown. Likewise for javascript in "included" files (<SCRIPT LANGUAGE=javascript SRC="<yoursourcegoeshere>")
Not true for the javascript case: the code is executed on the browser so the code must be downloadable by the browser.
You are right. It is executed in the front-end (browser). They are 2 different things.

What I meant to say was that the contents of the included scripts aren't visible in the "view source" option of the browser.

OJ

ntubski 09-16-2012 11:33 AM

Quote:

Originally Posted by AnanthaP (Post 4781319)
What I meant to say was that the contents of the included scripts aren't visible in the "view source" option of the browser.

In Firefox, the src attribute is a clickable link that leads to the script's source. At any rate, anyone who can view the source of the web page can also view the source of included javascript files.


All times are GMT -5. The time now is 03:53 AM.