NVS encryption in Platformio

Hi community… I was looking at this post…

I would like to bother you asking if i can if it is possible to
use the 2 flavours at encryption at the same time …

NVS supports two flavours of encryption:

runtime-encryption whereby the application itself generates the key and encrypts/decrypts data on the fly, and
build-time encryption whereby the nvs volume is pre-encrypted and flashed to the device

I need to store the certificates and keys as you explained but i also need to encrypt the wifi data (ssid and password) coming runtime.

another question related to this …
runtime-encryption whereby the application itself generates the key and encrypts/decrypts data on the fly, and

How can i do it… it is enough create the partition.csv ? and then enable the encryption inside menuconfig?

Once it is done … how can i store the data with nvs runtime encryption?

For the moment I am using the preferences lib in the arduino envioment…

Thanks a lot for your help in advance

1 Like

Similar question here. I’m able to enable encryption by using esp-idf directly, but I’d want to keep developing with PlatformIO. The issue I see is that once the device is encrypted (development mode) “upload and monitor” seems to stop working, since it’s expected that flash-encrypt would be used at this point.

and another use case here, I want to store keys and encrypt the NVS for security and tampering.