After hard searching for a way to protect my python code on raspberry pi from strangers access, finally, I'm convinced with all answers I read "No Way to protect python code".
But I still searching to protect my python code but now I'm searching away from python capabilities.
I read there are several ways to encrypt a directory.
So suppose that I have the following directory (/home/pi/Desktop/MyApp)
and suppose that the following python files and directories are exists on this directory: Main.py, class1.py, class2.py, ConfigurationDir, etc...
and suppose that I'm already modified the crontab file (to automatically allow running my app on every boot) by appending the following line to it: @reboot python /home/pi/Desktop/MyApp/Main.py &
Is there a way to encrypt this directory but keep crontab able to automatically access and run Main.py???
next part of the question is related to the encryption method:
I'm a vb developer also, in vb I were using methods to read the cpu and hdd serial numbers and then if they are different from stored numbers this means that the user copied the application to another pc, and so the app will not work. So, Can I do the same with python and sd card, I mean that my python app check rpi cpu id or any similar unique value, and if it doesn't exists or doesn't equal the stored one then it will prevent viewing the files (This means that if someone take off the micro sd card and tried to put it on another pc he will have no access to the python app directory)
So, I need an encryption method based on raspberry pi hardware unique Id's, that prevent any one from viewing python code either by connecting screen, keyboard and mouse or by moving sd card to another pc. and at the same time, keep the crontab able to access and run the python app on every boot or reboot, without the need for any additional steps...