0

First: maybe this is an XY-Problem: what I am really trying to solve is a poor-man's protection scheme against spying on our source code. We are using HALCON (an image processing library) in a C# project; The thing is that the HALCON parts are stored as plain source and are compiled/collected by the DLL only at the start of the program when you tell it where the source is. My intention is to have the source in encrypted form on disk and load/decrypt it to a part of memory at the start of the program prior to initialising the DLL. The idea is to deny access to the source through the file system (plugging in an USB stick and copying) - I am aware that this is a rather weak form of protection, if I am missing some obvious and superior way, please report.

I have been looking into RAM-Disks but these don't help in protecting as the application is on 24/7. Memory-based files would be ideal because they are gone when the application closes and should be more or less invisible to the outside world but I have to give the DLL a simple DOS file path (e.g. "C:/HALCON/ourproject") instead of a file stream/descriptor, so the question remains if one can (in Windows!) overlay the file system per process with a transient part residing in RAM.

Edit: I am using the HDevelop-Interface, that is, the HALCON procedures are called via the HDevProcedure objects which invoke a HALCON interpreter for a procedure.

Vroomfondel
  • 2,704
  • 1
  • 15
  • 29
  • How exactly are you connecting C# and Halcon code? – Vladimir Perković Apr 09 '19 at 15:42
  • 1
    @VladimirPerković I have edited my question accordingly. – Vroomfondel Apr 10 '19 at 07:57
  • Since the C# must have access to the key, it's really not *much* of an obstacle for someone to get to the source still. I maintain that the only real way to keep source safe is to only run the code on *machines you have control over*. If you can't do that, accept that legal recourse (breach of contract/copyright) are always there as fallbacks and spend time working on features that your customers will *value*. – Damien_The_Unbeliever Apr 10 '19 at 08:06

1 Answers1

0

Instead of using HDevelop directly you could convert your procedures to C# code: File -> Export or Export Library Project:

enter image description here

Your code will be compiled along with the rest of your project but you should be aware that decompiling C# programs is very easy.

Vladimir Perković
  • 1,351
  • 3
  • 12
  • 30
  • Thank you, I'll try. I have made the experience that the DLL and HDevEngine versions of operators diverge, tho. Some as simple as gen_rectangle1. :( – Vroomfondel Apr 10 '19 at 12:15