Suppose I want to transfer my home WiFi password to the ESP32 (which is in AP mode) so that the ESP32 can then switch to station mode and connect to my home network. I thought about using a hard-coded key to "encrypt" the data, but this can easily be hacked and the data sniffed and decrypted over the airwaves.
Then I thought about setting up SSL communication, but again, anyone with access to my product can read off the chip to find the private key and use that to steal information by sniffing the airwaves.
So, what's a good way to transfer sensitive information to esp32, or will I need to somehow alter the manufacturing process so that an open WiFi connection isn't used, but a unique AP password is hardcoded into the chip for every produced unit of the end product?
Exchanging keys securely?
Re: Exchanging keys securely?
This article seems to be a good read:
http://depletionregion.blogspot.com/201 ... ducts.html
Although, setting up bluetooth pairing is a bit of a pain (relatively speaking), and requires the end-user to have a BT capable device, not just a router. Any other ideas?
http://depletionregion.blogspot.com/201 ... ducts.html
Although, setting up bluetooth pairing is a bit of a pain (relatively speaking), and requires the end-user to have a BT capable device, not just a router. Any other ideas?
Re: Exchanging keys securely?
I had assumed that if an ESP32 was setup as an access point and I connected a WiFi device (eg. my phone) to the ESP32 then the data transmitted from my phone to the ESP32 was encrypted if I use WPA or WPA2 to authenticate? Wouldn't that secure access to the data?
In my models, I have an ESP32 boot up as an access point with a well known SSID and pre-defined static password. It then runs a Web Server. I then connect from my phone to the ESP32 (as an access point) and bring up the web page. I enter the SSID and password of my local WiFi access point/router and reboot the ESP32. Because it has saved the SSID and password in non volatile storage, it remembers the data and is able to connect to my home access point. In this is accurate, I don't see that my SSID/password pair ("the secret") was ever transmitted in an open or decryptable form. The worst that could happen is that someone "gets into" my ESP32 after it boots in access point mode and tries to set bad information for the target SSID/password.
In my models, I have an ESP32 boot up as an access point with a well known SSID and pre-defined static password. It then runs a Web Server. I then connect from my phone to the ESP32 (as an access point) and bring up the web page. I enter the SSID and password of my local WiFi access point/router and reboot the ESP32. Because it has saved the SSID and password in non volatile storage, it remembers the data and is able to connect to my home access point. In this is accurate, I don't see that my SSID/password pair ("the secret") was ever transmitted in an open or decryptable form. The worst that could happen is that someone "gets into" my ESP32 after it boots in access point mode and tries to set bad information for the target SSID/password.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Exchanging keys securely?
Yes, that was my original approach. Thing is, if it's a pre-configured AP password, capturing all the airwaves into a dump and then using your known key to decrypt the packets and retrieve the SSID and password of your home wifi is a trivial task.
Thing is, none of us want our products to show up on the news tomorrow for being hacked and thousands of passwords stolen.
Thing is, none of us want our products to show up on the news tomorrow for being hacked and thousands of passwords stolen.
Re: Exchanging keys securely?
What I mean is, if it's a default / known AP password with e.g. WPA2, those airwaves can all be captured into a dump and then anybody can use the default password to decrypt the packets. Wireshark supports this, I believe.
Re: Exchanging keys securely?
One way to potentially get an answer to our question is to search through existing products that we can find on the Internet and see what their setup procedures may be. Here is an example:
http://www.gelinkbulbs.com/downloads/GE ... lGuide.pdf
With this product,one seems to use Bluetooth from your mobile device to connect to the "WiFi IoT product" (which in our case might be an ESP32). We then use Bluetooth to interact with the ESP32 ... and in that conversation supply "the secret" which is then used by the ESP32 at next boot to connect to the local router.
Many thanks for pointing out that known passwords on an ESP32 when it is an access point could pose a vulnerability. I for one wasn't aware of that.
http://www.gelinkbulbs.com/downloads/GE ... lGuide.pdf
With this product,one seems to use Bluetooth from your mobile device to connect to the "WiFi IoT product" (which in our case might be an ESP32). We then use Bluetooth to interact with the ESP32 ... and in that conversation supply "the secret" which is then used by the ESP32 at next boot to connect to the local router.
Many thanks for pointing out that known passwords on an ESP32 when it is an access point could pose a vulnerability. I for one wasn't aware of that.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Exchanging keys securely?
Yes, you have to read/program the Mac address and serial number anyway so this is probably easy.arao23 wrote:but a unique AP password is hardcoded into the chip for every produced unit of the end product?
Who is online
Users browsing this forum: No registered users and 156 guests