Golang : How to protect your source code from client, hosting company or hacker?
My friend is bidding for a project and was asked by his client to let them host his program on a local machine. The client wanted to try out his software for 2 weeks before deciding to award the contract to him. He was afraid that the client might copy his source code or reverse engineer it.
He tries to reason with them to use the hosted solution from outside, but the client insist on hosting it on local machine at their place.
He asked what can he do to protect his source code?
After some brain crunching, I can think of :
Obfuscate his code with off the shelf obfuscator program.
Install a time-bomb that will lock the software after 2 weeks.
He plans to re-write his software in Golang. I think it is good just to give his client the binary instead of the source code. If the software is hosted with hosting company, just upload the binary to the server but keep the source code in house.... but this depends on whether the software is written in interpreted or compiled language.
It will be good idea to strip the binary of debugging information. In this way, the binary will be smaller and make the reverse engineering process twice harder. It will be cheaper for the client to buy the software from him.
Items 3 and 4 are applicable too if you don't trust your hosting company or worry that hacker might gain access to your source code sitting inside a host outsourced to hosting company. However, that is depends on whether you write your code in interpreted or compiled language.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+9.9k Golang : Pagination with go-paginator configuration example
+15.4k Golang : Display list of time zones with GMT
+8.3k Golang : Convert octal value to string to deal with leading zero problem
+5.2k CloudFlare : Another way to get visitor's real IP address
+12k Golang : Tutorial on loading GOB and PEM files
+11.9k Golang : Fix cannot use buffer (type bytes.Buffer) as type io.Writer(Write method has pointer receiver) error
+26.6k Golang : Get time.Duration in year, month, week or day
+13.1k Golang : Get current time from the Internet time server(ntp) example
+15.2k Golang : delete and modify XML file content
+10.1k Golang : Print UTF-8 fonts on image example
+20.5k Generate checksum for a file in Go
+7.4k Golang : Generate EAN barcode