Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypt wifi password #2886

Open
jasaw opened this issue Feb 11, 2024 · 2 comments
Open

Encrypt wifi password #2886

jasaw opened this issue Feb 11, 2024 · 2 comments
Labels
enhancement New feature or request won't do Out of scope for this project

Comments

@jasaw
Copy link
Contributor

jasaw commented Feb 11, 2024

The Feature

The wifi password is stored as clear text on the microSD card and AI-on-the-edge devices are typically installed outside the house where someone can easily steal the device.

We should add one layer of protection to make it slightly less difficult for people figure out the wifi password.

Proposal:

  1. Generate an encryption key (unique to each device) on start up if it doesn't already exist and store this encryption key in the ESP32 flash. This encryption key is never published anywhere, inaccessible via web interface.
  2. Read the wifi password from the SD card and look for some marker that allows us identify whether the wifi password is already encrypted or not.
  3. If wifi password is not encrypted, encrypt it, add marker, write it back to SD card.
  4. If wifi password is already encrypted, decrypt it (exclude the marker) and hand it over to the ESP32 stack to be used.

As for the encrypted wifi password marker, we could prefix a few non-printable characters to the encrypted wifi password string. If the user changes the wifi password on the SD card, the non-printable characters will be removed and triggers the encryption again.

The encryption can be a simple AES encryption.

@jasaw jasaw added the enhancement New feature or request label Feb 11, 2024
@SybexX
Copy link
Collaborator

SybexX commented Feb 12, 2024

AES encryption uses too many ESP resources compared to the benefits it brings.
If so, I would read the WiFi access data from the SD as normal and when a connection is established,
save the access data in the flash and delete it from the SD.
Then always check whether the Wlan.ini file exists or not, if not, then read the access data from the flash.
Of course if the access data is not available on the SD and Flash, an error will be output or the AP will start.

@jomjol
Copy link
Owner

jomjol commented Feb 13, 2024

Security features are by purpose not part of this public version. I do not plan to implement them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request won't do Out of scope for this project
Projects
None yet
Development

No branches or pull requests

4 participants