LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to protect my program? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-protect-my-program-4175432152/)

livesimply 10-14-2012 10:58 AM

how to protect my program?
 
hi
I am a Linux newbie, so I'll try to explain my problem.

I created a program in C# that receives command's from Ethernet and translates to the RS232 port.

I installed a Linux machine and then installed MONO. MONO permits running C# programs in Linux machines.

I need to let the system boot normally in console mode. At the end of the boot phase my program start working automatically.

My problem is that If i sell this system. Someone can copy my program and use it.

Is there any way to protect my program? The system File?
Even if someone connects directly to the system HDD?

What can I do?

thank you

TB0ne 10-14-2012 11:27 AM

Quote:

Originally Posted by livesimply (Post 4805436)
hi
I am a Linux newbie, so I'll try to explain my problem.

I created a program in C# that receives command's from Ethernet and translates to the RS232 port. I installed a Linux machine and then installed MONO. MONO permits running C# programs in Linux machines.

I need to let the system boot normally in console mode. At the end of the boot phase my program start working automatically. My problem is that If i sell this system. Someone can copy my program and use it.

Is there any way to protect my program? The system File? Even if someone connects directly to the system HDD?

The first thing I'd do would be to stop using a Windows/Microsoft language to write a program for Linux. Yes, you CAN use Mono to make it work, but it's not the best way to go. Write the program in C/C++, and compile it natively on Linux. The binary program will be on the system, but not the source code. Even at that...the program can be reverse-engineered or 'de-compiled', and let someone get your code, or at least enough of it to modify it.

No idea what you mean by "the system file", or what you mean by "someone connects directly to the system HDD", but if the system boots, someone can copy ANYTHING they want to another media. Welcome to the world of software development.

Also...I'm not sure why you wrote that program, since (based on your description), it does what the Linux program 'netcat' already does.

livesimply 10-14-2012 11:50 AM

Hello
What i mean by "the system file" is "the file system". I was wondering if its possible to encrypt the file system preventing any type of copy, Even if they take out the HDD (Hard Drive Disk) and tries to copy directly from it.

But i Understand that programing in C/C++ is better.

Thank you anyway

suicidaleggroll 10-14-2012 11:59 AM

You can encrypt the filesystem, but if you're selling this computer to somebody else you're going to have to give them the password so they can use it. The filesystem is going to have to be decrypted anyway in order to run your program, which means they can copy it off then.

Encrypted filesystems are only useful on machines that you have control over, and you're afraid that while the machine is out of your possession somebody might steal the hard drive, plug it into another machine, and pull the files off. While the machine is on and running, an encrypted filesystem is just as vulnerable as any other filesystem.

jefro 10-14-2012 12:21 PM

You further protect it either by some authentication scheme where one calls up or logs on to your server. Your server configures some part to work. Otherwise you need a type of external security device (sometimes called a dongle).

malekmustaq 10-15-2012 01:15 PM

Such ancient "proprietary" mentality: Is there a way I could write a dictionary and encrypt it so that whoever uses it is not able to define the words until maybe paying me for inventing dictionary?

Open it up so that others may improve it for the benefit of humanity.

segmentation_fault 10-15-2012 02:35 PM

You can distribute it under the terms of GPL. It will be protected in the way that no one can use your code in a proprietary work. If you want to make money from your software, that's a different subject.

TobiSGD 10-15-2012 03:24 PM

Point one: C# is neither a Windows nor a Microsoft language, it standardized by the ECMA: http://www.ecma-international.org/pu...s/Ecma-334.htm
There may be a political opinion whether to use it or not on free systems, but this is nothing more than an opinion and totally unrelated to the OP's question.

Point two: "Release it under the GPL" is also a political opinion and also totally unrelated two the OP's question. Why is it that many people that preach freedom forget the freedom of the developer to release under whichever license he wants to release?

@livesimply: As already pointed out, there are several ways to do what you achieve:
1. Use a hardware dongle that is detected at startup by your software. If it isn't present then your software simply should refuse to work after displaying a message that the dongle is missing. This is the most expensive solution and is only profitable for very expensive software.
2. Make the application call home to authenticate at startup. For this your software has to be identifiable (it needs a serial number and some type of hash for the hardware it is running on) This method will obviously not work if no Internet connection is available where your software is used and may have problems if your software runs in generic environments (like virtual machines), but should be OK if you sell your software together with the hardware.
3. Make some type of hash over the hardware your software runs on and generate a license key that is dependent on this information. this is the most used way, I would think.

Just keep in mind there is no way to be totally secure, if your software is interesting enough for people knowledgeable about cracking copy-protections your software sooner or later will be cracked.

JaseP 10-15-2012 03:28 PM

Another thing to consider,...

If your program "hooks" into the kernel, you may HAVE to release it under the GPL. For what I mean by that do a search on the net for the terms; GPL hooks viral license ... (not my terms or viewpoint, but it will be easier to bring up results about how/when code gets pulled into a GPL license).

Also, from a practical standpoint, I can't think of anyone who would want to install a proprietary program with DRM, when an open source alternative (or set of alternatives) exists. That said, RedHat made themselves into a $1B company in terms of annual revenue, while giving software away and selling support (and other stuff)... Just a thought.

segmentation_fault 10-15-2012 03:51 PM

Quote:

Originally Posted by TobiSGD (Post 4806453)
"Release it under the GPL" is also a political opinion and also totally unrelated two the OP's question.

It's not unrelated, and I think I explained in what manner GPL protects the author's work. Apart from that, I agree.

TobiSGD 10-15-2012 04:00 PM

Quote:

Originally Posted by segmentation_fault (Post 4806481)
It's not unrelated, and I think I explained in what manner GPL protects the author's work. Apart from that, I agree.

The OP asks specifically how he can prevent other people from copying his work to use it on other machines without getting a license from him. The GPL does in no way at all prevent that, in the contrary, the GPL specifically allows that.

TobiSGD 10-15-2012 04:03 PM

Quote:

Originally Posted by JaseP (Post 4806457)
I can't think of anyone who would want to install a proprietary program with DRM, when an open source alternative (or set of alternatives) exists.

Except the millions of Windows users, thousands of Photoshop users, all the programmers that use Visual Studio, ... .

livesimply 10-17-2012 02:23 AM

thank you for your advice TobiSGD
 
thank you for your advice TobiSGD

Quote:

Originally Posted by TobiSGD (Post 4806453)
Point one: C# is neither a Windows nor a Microsoft language, it standardized by the ECMA: http://www.ecma-international.org/pu...s/Ecma-334.htm
There may be a political opinion whether to use it or not on free systems, but this is nothing more than an opinion and totally unrelated to the OP's question.

Point two: "Release it under the GPL" is also a political opinion and also totally unrelated two the OP's question. Why is it that many people that preach freedom forget the freedom of the developer to release under whichever license he wants to release?

@livesimply: As already pointed out, there are several ways to do what you achieve:
1. Use a hardware dongle that is detected at startup by your software. If it isn't present then your software simply should refuse to work after displaying a message that the dongle is missing. This is the most expensive solution and is only profitable for very expensive software.
2. Make the application call home to authenticate at startup. For this your software has to be identifiable (it needs a serial number and some type of hash for the hardware it is running on) This method will obviously not work if no Internet connection is available where your software is used and may have problems if your software runs in generic environments (like virtual machines), but should be OK if you sell your software together with the hardware.
3. Make some type of hash over the hardware your software runs on and generate a license key that is dependent on this information. this is the most used way, I would think.

Just keep in mind there is no way to be totally secure, if your software is interesting enough for people knowledgeable about cracking copy-protections your software sooner or later will be cracked.



All times are GMT -5. The time now is 11:33 AM.