Securing Firmware Updates with AES Encryption
interrupt.memfault.com
interrupt.memfault.com
AES-CTR isn't ideal, a bit flip in the ciphertext flips the corresponding bit in the plaintext when decrypted. I.e. the image is mutable. The solution is to authenticate the data in a cryptographically secure manner. The article suggests using a CRC which is always trivial to circumvent.
A second issue is where to store the AES key. A mention is made of doing this in a secure manner on the device (which is good) but it must be in a form which doesn't allow access by an attacker -- either directly or via a side channel.
Instead of trying to create something, use TLS which will get the data to the device in a secure manner.