I have a small built-in Linux device with 128 MB flash memory for working with a notebook. This device runs the NGINX web server. To perform a firmware update - the system receives the encrypted binary file as HTTPS POST via NGINX to notepad. The system then decrypts the file and another QSPI flash device flashes to complete the update.
The firmware binary file is encrypted outside the device as follows:
openssl smime -encrypt -binary -aes-256-cbc -in plainfile.zip -out encrypted.zip.enc -outform DER yourSslCertificate.pem
The firmware binary file is decrypted after being received via NGINX on the device as follows:
openssl smime -decrypt -binary -in encrypted.zip.enc -inform DER -out decrypted.zip -inkey private.key -passin pass:your_password
I would really like to decrypt the binary, since it was received (on the fly) through NGINX, so it appears on the flash notebook in its decrypted form.
I could not find any existing NGINX modules on Google that would do this. How can i do this? Thank.
source
share