davdav wrote: ↑Thu Apr 25, 2019 1:30 pm
I think that first option is probably the most straightforward: when the device contact the server it will pass its current running partition number and server will provide the corresponding bin file.
Yes, this is probably the best solution for what you are trying to do now.
What is the purpose of the "address" parameter in "espsecure.py" command? I have looked the python code and it seems that the address is needed for some tweaking...
The reason the key is "tweaked" based on each flash address is to avoid chosen ciphertext attacks. For example, if an attacker can determine that the contents of flash at offset X decrypt to some particular sequence of bytes, they could copy that ciphertext to some other address Y and know it would decrypt to the same value when moved there.
davdav wrote: ↑Thu Apr 25, 2019 1:30 pm
The matter seems to be become a little complex: we will see internally how and if going forward with this, unless there is a another solution at "esp-idf" level...
We recognise that a lot of people want this kind of option to protect their OTA updates from interception/readout. We are planning to release a separate "encrypted OTA" scheme where a different key (stored in encrypted flash) is used to encrypt OTA images on the host and decrypt them when they are flashed (at which point they are re-encrypted using the flash encryption scheme). This "encrypted OTA" would be totally independent to the flash encryption key and scheme. However I'm afraid there is no ETA for this feature yet.