-->
Page 2 of 2

Re: Obfuscate code

PostPosted: Fri Sep 13, 2019 2:12 pm
by panoss
QuickFix wrote:You *might* be able to come up with some scheme that reads the unique serial of the ESP and check that upon boot

According to this ESP.getChipId() does not return a unique chip number.
They suggest the MAC address but how do I get it? Is there something like 'ESP.getMAC()'?
Or maybe it's the WiFi.macAddress()?

Re: Obfuscate code

PostPosted: Fri Sep 13, 2019 4:36 pm
by btidey
ESP.getChipId() is based on last 3 octets of the mac address so although not unique is unlikely to be repeated in a reasonable population.

WiFi.macAddress() is the arduino call to get the full mac address (6 octets with separating ':') It is expected to be unique. If someone guessed that you were checking this then they could replicate the mac address but it might make deployment trickier for them as all the copies based on one original would have the same mac address.

Re: Obfuscate code

PostPosted: Sat Sep 14, 2019 11:35 am
by panoss
Ok guys, thank you!

Re: Obfuscate code

PostPosted: Thu Sep 19, 2019 1:41 pm
by eriksl
Restricting access to the code is inherently impossible on the esp8266 because the flash can always be read (either using the boot loader or by desoldering the flash chip. It cannot do on-the-fly decryption like the esp32 can.

So what you're trying to do is impossible (even though some schemes SEEM plausible).

I think it's pretty lame to try to "protect" software. Better share it indeed, so you can also profit from other's contributions.