Hi,
Is there a way to protect littlefs files from USB access? I don't want to allow py and mpy files to be copied.
Protecting files on littlefs
Re: Protecting files on littlefs
You can disable MSC access by turning it off in your boot.py file. However, you'll still be able to access the files using a tool like rshell. You'd need to disable the REPL in order to fully disable file access that way.
That can all be circumvented by booting in safe mode: http://docs.micropython.org/en/latest/p ... #safe-mode so you'd need to disable that too.
You'd also want to disable sdcard booting, otherwise I could just write a little script which copies the contents of the internal flash onto the sdcard.
And unless you also turn off flash reading you can just download the filesystem using dfu-util:
viewtopic.php?f=3&t=5877#p33694
That can all be circumvented by booting in safe mode: http://docs.micropython.org/en/latest/p ... #safe-mode so you'd need to disable that too.
You'd also want to disable sdcard booting, otherwise I could just write a little script which copies the contents of the internal flash onto the sdcard.
And unless you also turn off flash reading you can just download the filesystem using dfu-util:
viewtopic.php?f=3&t=5877#p33694
Re: Protecting files on littlefs
Hi Dave,
Thank you for your reply. I forgot to mention that I'm using a ESP32-wroom module, so I don't have a problem with sdcard, mass storage etc My issue is the possibility of copying through like uPycraft, pyboard.py etc. A some semi-solution is to obfuscate the code via mpy-cross but I don't know why, one module (tinyweb) not working after conversion to .mpy.
Thank you for your reply. I forgot to mention that I'm using a ESP32-wroom module, so I don't have a problem with sdcard, mass storage etc My issue is the possibility of copying through like uPycraft, pyboard.py etc. A some semi-solution is to obfuscate the code via mpy-cross but I don't know why, one module (tinyweb) not working after conversion to .mpy.
Re: Protecting files on littlefs
Generally the ESP32 supports flash encryption, and the Pycom variant has a build option for it. Only that Pycom supports only it's own hardware. Modified their scripts supporting generic ESP32 too. Using that required you to build your own images. And the Pycom MP version lags behind the the genuine one. But it also has few benefits, like built-in ftp and telnet.
Edit: My Pycom firmware ESP32 variant: https://github.com/robert-hh/pycom-micr ... e/homebrew
compile & load with:
make BOARD=ESP32 FLASH_SIZE=4MB flash
You need the pycom build environment which includes a special copy of ESP-IDF (still 3.x).
Edit: My Pycom firmware ESP32 variant: https://github.com/robert-hh/pycom-micr ... e/homebrew
compile & load with:
make BOARD=ESP32 FLASH_SIZE=4MB flash
You need the pycom build environment which includes a special copy of ESP-IDF (still 3.x).