WARNING: Padding with 12 bytes of random data (encrypted data must be multiple of 16 bytes long)

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

WARNING: Padding with 12 bytes of random data (encrypted data must be multiple of 16 bytes long)

Postby snahmad75 » Wed Dec 05, 2018 9:47 am

Hi,
First I do signed of my partition then I encrypt it.

espsecure.py encrypt_flash_data --keyfile encryption_key.bin --address 0x8000 -o ./build/partitions-encrypted.bin ./build/signed_partitions.bin

espsecure.py v2.6-beta1
Using 256-bit key
WARNING: Padding with 12 bytes of random data (encrypted data must be multiple of 16 bytes long)

What this means?


Thanks,
Naeem

f.h-f.s.
Posts: 215
Joined: Thu Dec 08, 2016 2:53 pm

Re: WARNING: Padding with 12 bytes of random data (encrypted data must be multiple of 16 bytes long)

Postby f.h-f.s. » Mon Dec 17, 2018 4:16 pm

probably that data is encrypted in blocks of 16bytes. When the warning comes up it is encrypting something that is not a multiple of 16bytes, here you have a remainder of 4 bytes. this is why a random padding is added with a length of 12 bytes ( 4bytes data + 12 bytes padding = 1 block of 16bytes).

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: WARNING: Padding with 12 bytes of random data (encrypted data must be multiple of 16 bytes long)

Postby ESP_Angus » Mon Dec 17, 2018 10:46 pm

Yes, that's what it means.

You can ignore this warning, it should probably just say "note" instead.

EDIT: Have updated to esptool to say "note" as of the next release.

Angus

Who is online

Users browsing this forum: Bryght-Richard and 208 guests