0

Sketch Security Query
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Sketch Security Query

by _phillip on Sun May 30, 2021 2:58 pm

I would like to know how, or if, it is possible to protect a sketch from being copied or stolen. From what little I know about the subject all if would take is some knowledge of how to hook up a USB cable to the board and the sketch is exposed.

My project is not earth-shattering by any stretch, but I would like to protect my investment and hard work if possible. My project is enclosed within an enclosure, but a screwdriver would be all that it would take to access the board.

All thoughts and comments are most welcome.

Thanks!

_phillip
 
Posts: 134
Joined: Fri Apr 09, 2021 3:28 pm

Re: Sketch Security Query

by blnkjns on Sun May 30, 2021 3:10 pm

It is not that you can pull it off with regular USB, but you will need a debug tool through the debug headers. If you use a custom PCB for your final project without debug pins/headers, one needs to solder them on the IC pins directly. And then you have compiled machine code. You readable C++ .ino sketch then looks like:
Code: Select all | TOGGLE FULL SIZE
7c8f8d2e363b9813a97c069dd0d44cfd8169f693ea4bd2254e5740b4b5c3d281954bf40667f32c71b828895f6a6
f4dd5d1dd69e77a86ba0ff6c53be168ad959c048a105328fa333920094eebbc22b3006ffcf327d6a7569097a8ebcc930
f51afd02e3fc895906f042f6519edb1114f6ca435233d8beb908769cba65f1
You could try to recreate it into editable code, but that is not an easy job either.
Unless you are the next Apple, and try to prevent your code being ripped from Airtags, I would not bother very much. The video gives you an idea of what it means to reverse engineer firmware on a microcontroller.

blnkjns
 
Posts: 663
Joined: Fri Oct 02, 2020 3:33 am

Re: Sketch Security Query

by _phillip on Sun May 30, 2021 6:31 pm

Thank you VERY MUCH for that in-depth explanation. This concern has been in the back of mind for several months and now I have some valuable insight.

I sincerely appreciate your help.

_phillip
 
Posts: 134
Joined: Fri Apr 09, 2021 3:28 pm

Re: Sketch Security Query

by adafruit_support_mike on Sun May 30, 2021 10:08 pm

Take a look at Eric Raymond's _The Magic Couldron_:

http://www.catb.org/~esr/writings/cathe ... -cauldron/

It's one of the foundation documents of Open Source, and explores the economics of making a project Open or keeping it Closed. There are valid cases for both, but the reasons aren't always obvious.

adafruit_support_mike
 
Posts: 63053
Joined: Thu Feb 11, 2010 2:51 pm

Re: Sketch Security Query

by _phillip on Mon May 31, 2021 12:57 am

adafruit_support_mike wrote:Take a look at Eric Raymond's _The Magic Couldron_:

http://www.catb.org/~esr/writings/cathe ... -cauldron/

It's one of the foundation documents of Open Source, and explores the economics of making a project Open or keeping it Closed. There are valid cases for both, but the reasons aren't always obvious.


Thank you so much for your comments. The security - or lack thereof - aspects of our projects has always concerned me. The extremely helpful responses I have received from the Adafruit support team have been beyond constructive.

I cannot thank you enough for your help.

_phillip
 
Posts: 134
Joined: Fri Apr 09, 2021 3:28 pm

Please be positive and constructive with your questions and comments.