Arduino code safety

I am making a commercial product in transportation field and my product contains two arduinos (mega and uno) in my design box with few other components. Is there any way to make my code safe from outsiders because my box would be installed on the road and anybody can take my code??

plx help

and anybody can take my code??

Anyone with knowledge of the devices in the box (that should be locked), and the right hardware, can get the hex file that is uploaded. What they can do with the hex file is very limited. Converting the hex file to code is like converting an omelet to eggs.

The problem is even though my box would be locked but my competitors are strong enough to open that box and check the components. The only thing which i wants to safe is my code. Is there anything which evaporates the code so that even the developer cant get back the code again once its uploaded on the arduino.

Is there anything which evaporates the code so that even the developer cant get back the code again once its uploaded on the arduino.

You could look at the bootloader that loads a sketch from an SD card. Have just one useless sketch on the SD card. Set it up so that opening the box triggers the bootloader to load the new sketch.

Personally, I think you are worrying about nothing. Look up the AVRDUDE commands needed to extract a hex file from the Arduino. Take a look at the hex file. See if you can do anything with it.

What if the main supply is cutoff before opening the box?? The arduino wont be able to load new sketch from the SD card.

What if the main supply is cutoff before opening the box??

Battery backup?

Danish_Javed:
What if the main supply is cutoff before opening the box?? The arduino wont be able to load new sketch from the SD card.

Thermite and a starter which does not require a battery?

Danish_Javed:
The only thing which i wants to safe is my code

The Arduino is an OpenSource system.

The easiest way to make your code completely safe is to publish it. Then you can sleep nights.

...R

@Danish_Javed

I would suggest that you use the lock bits. atmega - Protecting AVR flash from reading through ISP? - Electrical Engineering Stack Exchange

Cheers!

PS: And if you intend to use open-source software consider contributing and then "you can sleep nights" :slight_smile:

I would suggest that you use the lock bits.

They do not guarantee that the code is unreadable. A high voltage programmer can change the lock bits back.

PaulS:
They do not guarantee that the code is unreadable. A high voltage programmer can change the lock bits back.

Changing the lock bits back is only possible with a chip erase command and that will erase program memory.

Cheers!

Using a bootloader is incompatible with using the lock bits to protect the code. You can protect your code from being read if you upload it appropriately using an ISP programmer, but you have to get rid of the arduino bootloader to do so.
(This protects your binary against "moderate" effort. I hear that there are still "overseas entities" that will provide the code given a "protected" chip and some "moderate" amount of money. ($100<x<$10000 ?)) (Or maybe they just take your money...)

@paulS yes battery backup

westfw:
I hear that there are still "overseas entities" that will provide the code given a "protected" chip and some "moderate" amount of money. ($100<x<$10000 ?)) (Or maybe they just take your money...)

Could be an interesting business - how would the customer know if the "code" wasn't just something dreamed up in a pub :slight_smile:

...R

pYro_65:
Thermite and a starter which does not require a battery?

I promote this solution!
(Because thermite)