1

I realize this must be a somewhat naive question, but I have written C++ program for a client. He needs the program installed on his machine, but I don't want to give him the code obviously. How can I protect the code so he doesn't have access to the source code? any suggestions to help me get started would be appreciated. thanks!

itcplpl
  • 780
  • 4
  • 18
  • 29
  • 7
    Um, C++ is a compiled language. Why can't you just give the client a compiled executable? – Michael Oct 01 '11 at 15:51
  • ok thanks, I can do that. I work on Linux and sometimes cygwin on windows, so I need to figure out what will work on his machine – itcplpl Oct 01 '11 at 16:12
  • "I don't want to give him the code obviously". Actually, not obvious. That really depends on the contract (which you two should have signed before you wrote the code). – MSalters Oct 02 '11 at 01:27

3 Answers3

3

Compile the program, and give him the compiled version? Like most computer programs?

Beyond that, I refer you to Protecting executable from reverse engineering?

Community
  • 1
  • 1
Amber
  • 507,862
  • 82
  • 626
  • 550
  • ok, I read your post on the reference you give and it seems like there's really no way to completely insulate it. – itcplpl Oct 01 '11 at 16:13
2

You don't have to give your customer the source code of your program. Generally speaking, he should only need the executable program.

Danilo Piazzalunga
  • 7,590
  • 5
  • 49
  • 75
  • ok, thanks, so if he is using windows, then I should compile it on a windows platform. And if he is using Linux, then I compile it on that platform to provide him the .exe. – itcplpl Oct 01 '11 at 16:03
2

C++ is a compiled language. That means that after compilation, the compiler will generate a binary file which contains machine code - for example, a dll, a lib or an exe file under Windows. In windows, all you have to do is deliver the exe's and associated dll's, if they are not already present on the client's machine. There can be different versions of the binaries (depending on platforms, e.g. 32bit vs 64bit compilations) so you might have to run more compilations and let an installer utility handle the distribution.

Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625
  • ok, got it. when you say let an installer utility handle the distribution, I don't fully understand. can you elaborate on that please. – itcplpl Oct 01 '11 at 17:39
  • 1
    Well, search for windows installer, for example. You can specify configurations and add corresponding binaries to them - for example, add some binaries if client is using x86 and others for x64. – Luchian Grigore Oct 01 '11 at 18:01