Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

Prevent viewing and editing of CircuitPython code?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Prevent viewing and editing of CircuitPython code?

by morgab on Thu Mar 05, 2020 10:51 am

I'm currently testing a PyPortal. I'm evaluting if I can use CircuitPython in a product to offer customers.
However, I've noticed that CircuitPython code is viewable (just plug the board into the USB port and open the code files).
I want to prevent viewing and copying of the code I make.
Is it possible to make the code into binaries that runs on the board, that can't be viewed and edited, similar to how Arduino sketches are uploaded to Arduino based boards?

morgab
 
Posts: 3
Joined: Thu Feb 13, 2020 9:44 am

Re: Prevent viewing and editing of CircuitPython code?

by tannewt on Thu Mar 05, 2020 1:46 pm

morgab wrote:However, I've noticed that CircuitPython code is viewable (just plug the board into the USB port and open the code files).


This is by design. CircuitPython is meant to make it easy to see and modify code on a device.

You could prevent the drive from appearing by modifying the USB settings but it wouldn't prevent folks from reading the files off of the flash.

tannewt
 
Posts: 1536
Joined: Thu Oct 06, 2016 8:48 pm

Re: Prevent viewing and editing of CircuitPython code?

by tomhawkins on Wed Mar 11, 2020 6:46 am

With standard MicroPython I believe the answer would be to compile your own build of MicroPython from source, including your code as frozen bytecode. I'm sure a determined attacker could still decompile it but it wouldn't be open to a casual hacker. I guess the same should be possible with CircuitPython?

tomhawkins
 
Posts: 4
Joined: Thu Sep 26, 2019 12:05 pm

Please be positive and constructive with your questions and comments.