esp-now: How can I find out if a message is encrypted or not?

blubb
Posts: 115
Joined: Mon Jun 22, 2015 5:35 am

esp-now: How can I find out if a message is encrypted or not?

Postby blubb » Sat May 16, 2020 10:08 pm

My project switches devices on and off and is not necessarily logged onto a WiFi. So I thought esp-now is worth a try. For security reasons I need encryption so that no unauthorized sender can switch on/off my device. My understanding is that I need to register the possible receivers using

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?

Who is online

Users browsing this forum: No registered users and 8 guests