I've done something like this for my company.īut keep in head that you can't perfectly secure your product if someone has a physical access to it. 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.
![how to stop sd card encryption how to stop sd card encryption](https://images.imyfone.com/anyrecover/images/public/encrypt-sd-card-with-diskpart-utility-1.jpg)
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. 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)
#HOW TO STOP SD CARD ENCRYPTION SERIAL NUMBERS#
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. Next part of the question is related to the encryption method: Is there a way to encrypt this directory but keep crontab able to automatically access and run Main.py? So suppose that I have the following directory (/home/pi/Desktop/MyApp)Īnd suppose that the following python files and directories are exists on this directory: Main.py, class1.py, class2.py, ConfigurationDir, etc.Īnd suppose that I'm already modified the crontab file (to automatically allow running my app on every boot) by appending the following line to python /home/pi/Desktop/MyApp/Main.py & I read there are several ways to encrypt a directory.
![how to stop sd card encryption how to stop sd card encryption](https://i0.wp.com/techverse.net/wp-content/uploads/2014/01/turn-on-sd-card-encryption-android.jpg)
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".īut I still searching to protect my python code but now I'm searching away from python capabilities.