Out of the ballpark Question about arduino coding?

Hello i was wondering if it is possible to stop others from coping arduino code from my project? i was reading online that there is a way might be to read other peoples code on there projects. But i was wondering if there was a way to program it so it cant be read?

Yes, but that makes it more difficult for you to program the thing in the first place.

Remember the code you wrote is compiled into binary before it's put onto the Arduino. Even if someone has the skill to download the binary, they don't get your code.

Hello thank you Morgan. So the ide converts the code what I'm seeing in the arduino program in the background it converts it to Binary that is something new i learn pretty cool. But can't the Binary code still be looked at and figure what it is? Just curious.

But can't the Binary code still be looked at and figure what it is?

Yes, it can be disassembled, but the compiler will have done such a good job of optimising that it is unlikely that even the original author would recognise their own work.

josephchrzempiec: But can't the Binary code still be looked at and figure what it is?

That's a bit like getting milk back into a cow....

Anyone with the skill to do that, would almost certainly have the skill to write the code from scratch to do the same thing, I'd say.

Yes, the best way to protect your code involves copyrights, trademarks and patents. The code is probably only one of the components of your product.

Hello Awol and JimboZA thank you for the information they are very good points there to thinking about and Thank you Morgan lol i wish i had money like that maybe i can pay more bills :(

JimboZA: That's a bit like getting milk back into a cow....

The primary purpose of cows is to put milk into calves ? ?

...R

In all the countries I’m familiar with, copyright is automatic. Once you’ve created a work such as a book or a painting or a computer program it’s yours. Certain additional protections come into play when you put (C) on, but your work is still copyright without that.

A trademark registration is very cheap: $25 or so. However it’s easy to get it wrong and the trademarks office won’t tell you what you got wrong. ($25 doesn’t buy a lot of advice.) Lodging a trademark application should not cost more than a few hundred bucks with advice from a real attorney.

Oh, your code isn’t worth big multiples of $100? Then why are we having this conversation?

The ATmega328P has configurable lock bits. By clearing LB1 and LB3 (to set LB Mode 3) you disable writing or verifying the FLASH and EEPROM. This will keep anyone (including you) from reading or modifying your sketch. After that the only way to re-program the chip is to do a Chip Erase which clears all of FLASH and EEPROM, keeping your secret safe.

You will probably want to get an ISP device since the bootloader obviously can't erase itself. This will also allow you to eliminate the bootloader. which might give someone read access to your binary code.

Of course someone could remove the top of your chip and read the code that way. It takes some specialized equipment so unless your sketch is very valuable it would be cheaper to break into your system and steal the source.

There was actually a fairly extensive discussion about this on another thread recently

http://forum.arduino.cc/index.php?topic=330743.0

What you really should consider is that it is not your code that is of real value, it is the ideas contained within the code. Unless your code contains something absolutely unique (say a one of a kind math formula), basic protection of the code with the lock bits should suffice.

I enjoy these code protection discussions, and I will expand on why (don't judge!). I used to work as a freelance coder for a popular online game. Frequently a coder would come up with something new and unique, and while I do feel that people should be compensated for their work and time, often these coders would greatly overvalue their work, this made it so only a few server operators could purchase the right to use that code.

Enter people like me, on occasion my task was to go to the server where some code was being used, play around and figure out what it did, and then duplicate the functionality. I certainly was not the only coder doing this, and as a community we (the coders) actually in a way punished those who overvalued their work, in that frequently after we duplicated the functionality of someones work we would release the source to everyone. This completely devalued the original work.

I say all of that to say this, it is far easier to duplicate the functionality of someone's design than it is to create an original idea, as soon as any product is in the hands of the public you have shared the idea, and there is someone out there capable of duplicating your product with or without your code.

Set the lock bits, they are a bit like the lock on the door of your house, they will keep the honest people out, but are not going to prevent someone that is truly determined from gaining entry.

I would like to thank all for the information it help me a lot to think about stuff. As some say is the code really worth it to keep secret i do not know. is it worth it? to me yes in many ways it is valuable? i honestly don’t know surely others can figure out how i did it if they really want to. So it really brings it down to what i want to do about it. Just leave it alone or encrypt the code or somehow block it from others trying to viewing it though some means. That i do not know at this point. But there are a lot of great points in this post from all of you and i thank you for that.

I certainly was not the only coder doing this, and as a community we (the coders) actually in a way punished those who overvalued their work, in that frequently after we duplicated the functionality of someones work we would release the source to everyone.

I agree with this. Let's imagine we are in prehistoric times, and someone "invented" the wheel as a way of moving things from A to B more easily (or B to A, I suppose).

Does that person really expect to live in luxury for the rest of their life because this was their invention? Surely if they hadn't invented it, someone else would have? It is hard to believe that today, in 2015, we wouldn't have motor cars because one brilliant person in the year 1000 BC came up with the idea of a wheel.

Hello nick i understand where you are coming from and you are right. I'm not trying to hide anything really i like sharing what I'm doing in here just trying to put my mind at rest on this thought that's all.

Although it would not prevent someone from copying the binary code and using it you could include "Easter egg" code in your program whereby some combination of inputs caused a special output, maybe flashing LEDs in a particular pattern, that was nothing to do with the project. Then, should you see a device that seemed to use your code, you could activate the "Easter egg" as fairly good proof that you wrote it. This would be easy to incorporate into your program and should you catch anyone would be quite satisfying.