Page 1 of 1

NVS decryption doesnt work [IDF-1922]

Posted: Mon Jul 13, 2020 1:51 pm
by AlexESP32
Hey ;)

I tried to decrypt the nvs partition and unfortunately it doesnt work.

The command is:
python nvs_partition_gen.py read_nvs.bin nvs_key.bin neu.bin

The error message is this:
Traceback (most recent call last):
File "nvs_partition_gen.py", line 1037, in <module>
main()
File "nvs_partition_gen.py", line 1033, in main
args.func(args)
File "nvs_partition_gen.py", line 800, in decrypt
empty_data_entry = bytearray('\xff') * 32
TypeError: string argument without an encoding

Is there a fault on my side?

Thank you ;)

Re: NVS decryption doesnt work [IDF-1922]

Posted: Wed Jul 15, 2020 9:52 am
by ESP_Roland
Hi Alex.

This seems to be an incompatibility issue. We will look into this.

Re: NVS decryption doesnt work [IDF-1922]

Posted: Wed Jul 15, 2020 5:28 pm
by AlexESP32
Okay :)

Re: NVS decryption doesnt work [IDF-1922]

Posted: Thu Jul 16, 2020 6:47 am
by ESP_Roland
In the meantime, the workaround is to use temporarily Python 2 or edit "nvs_partition_gen.py", line 800 by adding a "b":

Code: Select all

empty_data_entry = bytearray(b'\xff') * 32

Re: NVS decryption doesnt work [IDF-1922]

Posted: Wed Jul 22, 2020 6:53 am
by ESP_Roland
For future reference, commit cb0bdb8bba774c0d5a670f73a23ca882dfddd2b6 will solve this issue and will be backported to all release branches.

Re: NVS decryption doesnt work [IDF-1922]

Posted: Wed Jul 22, 2020 7:04 pm
by AlexESP32
Thank you ;)

Re: NVS decryption doesnt work [IDF-1922]

Posted: Mon Aug 03, 2020 9:53 am
by ESP_Alvin
Hi AlexESP32,

The fix on master is available at https://github.com/espressif/esp-idf/co ... 45f32d65fd. Thanks.

Alvin