Below is the quick start guide for encrypting the application and factory partition but before proceeding further please READ THE DOCS FIRST. Documentation References:
idf.py menuconfig
partitions_encrypted.csv
partition table [Partition Table → Custom partition CSV file]Please enable the below options if you want to use ESP32 Factory Data Provider
generate_esp32_chip_factory_bin.py
script-e
option along with other options to generate the encrypted factory partitionfactory_partition.bin
and keys/nvs_key_partition.bin
Flash the application using idf.py flash
.
NOTE: If not flashing for the first time you will have to use idf.py encrypted-flash
Flash the factory partition, this SHALL be non encrypted write as NVS encryption works differently
esptool.py -p (PORT) write_flash 0x9000 path/to/factory_partition.bin
esptool.py -p (PORT) write_flash --encrypt 0x317000 path/to/nvs_key_partition.bin
NOTE: Above command uses the default addressed printed in the boot logs