Building a secure embedded solution requires protecting it from attacks targeting the communication channel.
Usually this means encrypting all traffic on that channel.
This can be done in hardware or software or a combination of both.
An open source cryptography software solution can be found here:
https://tls.mbed.org
What is mbed TLS?mbed TLS is an open source and commercial SSL library licensed by ARM Limited..
source code: https://tls.mbed.org/source-code