esp_now_add_peer(MAC1, ESP_NOW_ROLE_COMBO, CHANNEL, key, sizeof(key));
Now the problem is, I can still receive unencrypted messages, e.g. broadcast messages. And there is no way I can find out that they actually were unencrypted! So any attacker can easily forge messages that switch on and off my devices. How do I prevent that?
For instance, When sending a packet
If the Auth package matches your algorithm then you can trust it, but only up until someone else finds it out but if you can keep that secret then your fine. When you receive a package from the sender you'll look at the Auth code after the data (or before), crunch the same algorithm which is essentially you key in this example and confirm that that value matches the sender's Mac and call it good. That way if someone sniffs that value they will have to spoof the mac at least or figure out the algorithm by hand(don't count on this unless they have clues), but if you're trying to prevent those two from happening then you're going to be chasing a tail at some point where you just can't do much more without adding other infrastructure in the mix.
Who is online
Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 9 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!