LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2012, 10:58 AM   #1
livesimply
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Rep: Reputation: Disabled
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
 
Old 10-14-2012, 11:27 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by livesimply View Post
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.
 
1 members found this post helpful.
Old 10-14-2012, 11:50 AM   #3
livesimply
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-14-2012, 11:59 AM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.

Last edited by suicidaleggroll; 10-14-2012 at 12:01 PM.
 
1 members found this post helpful.
Old 10-14-2012, 12:21 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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).
 
Old 10-15-2012, 01:15 PM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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.
 
Old 10-15-2012, 02:35 PM   #7
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
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.
 
Old 10-15-2012, 03:24 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
1 members found this post helpful.
Old 10-15-2012, 03:28 PM   #9
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
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.
 
Old 10-15-2012, 03:51 PM   #10
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Quote:
Originally Posted by TobiSGD View Post
"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.
 
Old 10-15-2012, 04:00 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by segmentation_fault View Post
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.
 
3 members found this post helpful.
Old 10-15-2012, 04:03 PM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by JaseP View Post
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, ... .
 
Old 10-17-2012, 02:23 AM   #13
livesimply
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thumbs up thank you for your advice TobiSGD

thank you for your advice TobiSGD

Quote:
Originally Posted by TobiSGD View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protect souvik Programming 3 11-06-2015 01:35 PM
Protect from other sudoers? ktek Linux - General 12 11-27-2008 09:52 PM
Protect my pc from Hackers shipon_97 Linux - Newbie 1 03-26-2006 10:55 AM
How Do You Protect Yourself? nuka_t Linux - Security 5 08-18-2004 11:35 PM
What does the GPL protect? Thaidog General 4 06-28-2004 02:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration