0

I currently have a c++ application that calls a python code file. I would like to know if there is a way to hide this file or put some kind of password to open it and that you can continue call from the c++ code.

EDIT: I need call python because i use keras library. That is the reason that i don´t port the code I import python code with PyImport_ImportModule and PyObject

Thanks in advance.

pepe
  • 9
  • 2
  • So what I understand is that you want to create a python library which only you can edit. You might want to look into [read only library](https://pypi.org/project/read-only-property/) – Hamza Jul 19 '19 at 07:53
  • speaking from a security perspective, I believe what you need is to encrypt your python file with an asymmetric key – Arne Jul 19 '19 at 08:10
  • Perhaps writing out the python file on the fly, executing it and deleting it afterwards? – Aconcagua Jul 19 '19 at 08:14
  • On the other hand, why do you need the python file at all? Why not port it to C++? – Aconcagua Jul 19 '19 at 08:15
  • You could encrypt the python part and have the C++ part decrypt it for use. – nada Jul 19 '19 at 08:38

1 Answers1

3

The question is from whom you like to hide the content of the python file.

If you like to ship the application to some customer, you may compile the python file to a binary.

schorsch312
  • 5,553
  • 5
  • 28
  • 57