SecurePair: encrypted pairing between two ESP32 boards confirmed with an LED
SecurePair is a library for Open Electronics that pairs two ESP32 boards over a single LED and a button on each one. It’s at beta 0.5. It handles the whole encrypted link: agreeing on a fresh key, confirming it with the user, and passing authenticated messages back and forth.
The confirmation code is 20 bits, shown as 20 short and long flashes synchronized between the two boards. A device in the middle has a one in 1,048,576 chance of guessing it per try. Optical pairing works up to 2 m apart. The same protocol also runs over ESP-NOW for tens of meters or LoRa for kilometers.
Pairing uses fresh X25519 keys, and messages in each direction have their own AES-256-GCM key. Boards hold a permanent identity and store up to 8 peers, or 16 if configured. The library runs on the whole ESP32 family, including the C3, S3 and P4, and relies on Mbed TLS that ships with the ESP32 core. The optical side uses the PacketLED library.
See more at open-electronics.org and content on GitHub .




Comments
No comments yet. Be the first to share your thoughts.