08-12-2019 02:21 AM
Hi there,
is there a way to protect my *.py files, which I call from within LabView? Or is this going to be implemented into the *.exe file after I build the project (and if so, is this sufficent protection)?
Thanks
08-12-2019 06:27 AM - edited 08-12-2019 06:32 AM
@mw42 wrote:
is there a way to protect my *.py files, which I call from within LabView? Or is this going to be implemented into the *.exe file after I build the project (and if so, is this sufficent protection)?
It looks like the Python Node needs a path to a .py file - regardless if you run your code as a .vi or as an .exe
could you be more precise about "protection" ?
in terms like "read-only"?
in terms like encryption?
08-12-2019 06:36 AM
The idea of Python is openness so in a way it goes against that, but put the file in a password protected zip? I think LV can handle that and the zip should work like a folder. I might be way off though.
/Y
08-12-2019 02:30 PM - edited 08-12-2019 02:34 PM
@Yamaeda wrote:
The idea of Python is openness so in a way it goes against that, but put the file in a password protected zip? I think LV can handle that and the zip should work like a folder. I might be way off though.
/Y
I had that in mind to
but I can't say if that would work, ... any thoughts?
http://sine.ni.com/nips/cds/view/p/lang/de/nid/209027
08-12-2019 03:58 PM - edited 08-12-2019 04:04 PM
Yes the Openg ZIP library has a possibility to extract files inside a password protected archive and even extract it directly into a memory buffer without the need to write it to a file on disk. However I'm not sure if the Python Node supports passing a in memory file as a string or always requires a path to a real file on disk. If it doesn't you still would need to save the file to a temporary location and then specify its name to the Python Node. And that temporary file would not be encrypted.
It still would allow to make reasonably sure that a user can't modify the file before being executed but he could intercept it and copy it and then read its contents.
08-13-2019 03:01 AM
I guess the other option is to have Exectute only-flag on the file or have the program run as a separate user and only have read access to that user.
/Y