These are an example code using open-source code.
PC to Arduino sends or receives data on XMODEM protocol using AES CBC 128.
PC uses python to sends or receives data on Serial(UART) channel
I found that XMODEM library is not easy to implement, so I share my own solution.
Licenses are following their own licenses.
Arduino XMODEM library
https://github.com/mgk/arduino-xmodem
Arduino AES library
https://github.com/DavyLandman/AESLib
python XMODEM library
https://pypi.org/project/xmodem/
python AES library
https://pypi.org/project/pycryptodome/