NVS decryption doesnt work [IDF-1922]

AlexESP32
Posts: 65
Joined: Thu Oct 03, 2019 9:41 am

NVS decryption doesnt work [IDF-1922]

Postby AlexESP32 » Mon Jul 13, 2020 1:51 pm

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 ;)

User avatar
ESP_Roland
Posts: 237
Joined: Tue Oct 09, 2018 10:28 am

Re: NVS decryption doesnt work [IDF-1922]

Postby ESP_Roland » Wed Jul 15, 2020 9:52 am

Hi Alex.

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

AlexESP32
Posts: 65
Joined: Thu Oct 03, 2019 9:41 am

Re: NVS decryption doesnt work [IDF-1922]

Postby AlexESP32 » Wed Jul 15, 2020 5:28 pm

Okay :)

User avatar
ESP_Roland
Posts: 237
Joined: Tue Oct 09, 2018 10:28 am

Re: NVS decryption doesnt work [IDF-1922]

Postby ESP_Roland » Thu Jul 16, 2020 6:47 am

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

User avatar
ESP_Roland
Posts: 237
Joined: Tue Oct 09, 2018 10:28 am

Re: NVS decryption doesnt work [IDF-1922]

Postby ESP_Roland » Wed Jul 22, 2020 6:53 am

For future reference, commit cb0bdb8bba774c0d5a670f73a23ca882dfddd2b6 will solve this issue and will be backported to all release branches.

AlexESP32
Posts: 65
Joined: Thu Oct 03, 2019 9:41 am

Re: NVS decryption doesnt work [IDF-1922]

Postby AlexESP32 » Wed Jul 22, 2020 7:04 pm

Thank you ;)

ESP_Alvin
Posts: 195
Joined: Thu May 17, 2018 2:26 am

Re: NVS decryption doesnt work [IDF-1922]

Postby ESP_Alvin » Mon Aug 03, 2020 9:53 am

Hi AlexESP32,

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

Alvin

Who is online

Users browsing this forum: No registered users and 118 guests