Page 1 of 1

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

Posted: Wed Dec 05, 2018 9:47 am
by snahmad75
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

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

Posted: Mon Dec 17, 2018 4:16 pm
by f.h-f.s.
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).

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

Posted: Mon Dec 17, 2018 10:46 pm
by ESP_Angus
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