I was working with the Arduino IDE. I tried to find out from where a MCU can be locked so that nobody can make a clone from it. I found many answers describing something about lock bit. I realized that this lock bit can somehow stop users from cloning the chip. My first question is with which IDE or programmer I can change the lock bit? Second question : Can it be edited with a hex editor? If it is possible, what is the position/which number of bit should be changed? Third question: Is there any way to encrypt the code?
Asked
Active
Viewed 499 times
0
-
1The lock bits are in a separately programmable flash area as the fuse bits are. They aren't part of the program file. It depends on your IDE where you can set them. – Janka Jun 20 '19 at 22:31
-
But how do I set it?? With what? – Sohan Arafat Jun 20 '19 at 22:32
-
Does the Arduino IDE has a menu for the fuse bits? The lock bits should be there, too. If not, you needed an ISP programmer and e.g. avrdude as the programming app on your PC. If you don't have an ISP programmer but two Arduinos, you can wire up one Arduino as an ISP programmer and use that one to program the other. – Janka Jun 20 '19 at 22:41
-
Also, the lock bits can be defeated by undervoltaging the chip. Standard procedure for seasoned crackers. – Janka Jun 20 '19 at 22:43
-
@Janka Do you have more information on that? It sounds interesting. – marcelm Jun 20 '19 at 23:51
-
@marcelm, google it .... if you do not understand what you find, post a question about it – jsotola Jun 21 '19 at 02:28
-
@SohanArafat, it is pointless to encrypt the code .... it would protect against determining the source code, but it would not protect against making an exact copy of the content of the flash memory – jsotola Jun 21 '19 at 03:10
1 Answers
0
The lock bits can be used to prevent reading the code memory with standard programming tools. It only works up to a certain point, as a determined hacker with right tools can still extract and clone the firmware. So you can use the lock bits but don't expect that it will be 100% effective.

Justme
- 127,425
- 3
- 97
- 261