# SSL from a Microcontroller

I am wanting make an embedded device that can communicate with a web-server in a secure fashion. My preference would be for it to use standard SSL so the web-server views my device similar to a web browser.

• Are there any prebuit libraries for the embedded side to do this?
• What about an IC that can handle the handshaking and decryption for me?
• If not how would I go about doing this myself?
• If you haven't seen this, you may consider it for it's small size, powerful capabilities, but not cheap price: phidgets.com/products.php?product_id=1072 – gahooa Feb 18 '11 at 18:33
• @gahooa that is interesting. I am looking for a cheap option though. My market would be buying 10's or 100's of my device so every cent I can cut costs can help make the item more marketable. – Kellenjb Feb 18 '11 at 19:00
• I hope you have a BIG micro. SSL Is pretty heavy, computationally. – Connor Wolf Feb 19 '11 at 6:58
• @Fake Name I was thinking a dsPIC. The way I understand it is the initial handshaking can be pretty heavy, but everything else is not too bad. – Kellenjb Feb 19 '11 at 16:48

## 4 Answers

I suggest the Microchip TCP stack. Microchip offers a free licensed TCP/IP stack optimized for the PIC18, PIC24, dsPIC and PIC32.

Microchip’s TCP/IP stack includes the Secure Sockets Layer (SSL) feature.

But it's not free. See below:

To comply with US Export Control restrictions, the encryption portion of the SSL module must be purchased separately from Microchip. The library of Data Encryption Routines (SW300052) is available for a nominal fee from http://www.microchipdirect.com/productsearch.aspx?Keywords=SW300052.

For better results, you can use ENCx24J600 that has built-in AES encrypt/decrypt engine and other securities engines.

• Not free, but only $5. – Robert Feb 18 '11 at 21:42 • Very cheap! I didn't know that. – Daniel Grillo Feb 21 '11 at 14:18 • @Robert and @Daniel Grillo I believe it is$5 for the starter package and then once you go retail its about $2,500 for 5000 units. At least that is what it is for this: microchip.com/stellent/… – Kellenjb Feb 23 '11 at 13:46 • However, the ENCx24J600 is the part that interests me a lot. – Kellenjb Feb 23 '11 at 13:48 Consider these embedded SSL libraries: http://www.yassl.com/yaSSL/Products-cyassl.html http://polarssl.org/ http://www.matrixssl.org/ And maybe http://gitorious.org/tropicssl/ Tropicssl and polarssl originated from http://www.ohloh.net/p/xyssl Tropicssl and xyssl are BSD licensed, whereas as all the others are GPL with an option for a proprietary license for$.

If the system can be complicated enough to run an operating system, there are plenty of tools and libraries that can do the job. On an embedded Linux system, you can use wget with SSL. On any system with higher level languages like Python or Ruby, the networking library (Python SSL) will support SSL. If you only have access to C, you could write something using the OpenSSL library.

If there's no OS, I think you're in for a lot of work. At minimum, you need a TCP/IP stack. I'd build a prototype with an mbed-- there's a forum post that suggests they might have an SSL library by now.

This seems to support AES SSL as well: http://www.lantronix.com/device-networking/embedded-device-servers/xport.html

• I don't believe this actually supports SSL - AES is just a symmetric cipher that can be used by SSL but e.g. the handshake requires other steps that involve (usually) RSA and SHA-1. However Lantronix now has the XPort AR which does appear to support some version of SSL lantronix.com/device-networking/embedded-device-servers/… however it's not cheap. – thom_nic Feb 2 '15 at 14:47