espressif / idf-extra-components

Additional components for ESP-IDF, maintained by Espressif
143 stars 86 forks source link

Is the magic number in Encrypted image header static or dynamic hash? (IEC-72) #274

Closed dingiso closed 8 months ago

dingiso commented 8 months ago

Answers checklist.

General issue report

Dear esp_encrypted_image maintainers:

There is a Image Magic field at the top of the encrypted image header. I am confused about whether this field is static or dynamic.

https://github.com/espressif/idf-extra-components/blob/440f7d0c815eb9627420d7e3c40f9782e791b564/esp_encrypted_img/tools/esp_enc_img_gen.py#L17-L18 The comment of above codes says that it is a hash number of the image. However, this magic number is hardcoded in the python script and the README says that this script can be directly used to generate the encrypted image.

So is the magic number a dynamic hash or a static value ?

Thanks, Dingisoul

mahavirj commented 8 months ago

@dingiso

Magic value in the header is static. The comment only explains how the magic bytes were derived.

dingiso commented 8 months ago

Thanks, mahavirj. I get it