Suggested addition to documents: wireless security

Hi all, I was wondering whether it might be possible for someone to put together a page or two in the documentation site which covers all of the security in the spark? For example, what role does the core ID play, is there end-to-end encryption between the cloud and the spark or do I need to use SSL/https? Is there any way of securing the spark once deployed in the field to prevent hardware hacking by malicious entities or competitors (I know PICs have a firmware switch which prevents code extraction)?

I’m sure there are many other such security areas we all want to know about. Any further suggestions welcome.

1.) Spark <<----->> core communication has been encrypted at 128-bit right from day 1
128-bit encryption

From Kickstarter:

The Core, the Cloud, and the entire Spark development platform is secured with industry-standard AES (on the hardware side) and SSL (on the API side) encryption to keep all your wireless communications in the right hands.

But not sure if it is a must for SSL on the cloud or at least the local :cloud:

2.) You need access token in order to even communicate with the core. Also, the core is already programmed to hit the right server ip with a correct server public key.

It just doesn’t make sense to me that someone can ever hack it :stuck_out_tongue:

I’m sure @Dave will be happy to put together some official docs once we have some spare time :slight_smile:

Hi @NanoAkron,

I think that’s a great idea! I’ll add an issue for that here: https://github.com/spark/docs/issues/193

Regarding the protocol, here’s a quick overview - https://community.spark.io/t/how-does-sparkcore-maintain-connection-to-cloud-api/2300/2?u=dave

Your core’s unique public/private keypair is associated with its unique core id, and the core has a stored copy of the server’s public key. I believe the stm32 has flags that let you protect certain regions of flash, and it’s how we protect the bootloader from being accidentally overwritten, so I would think you could use that to protect your firmware as well.

I hope that helps! :slight_smile:

Thanks,
David

1 Like

So can I ask - when I create a TCP or UDP connection to a server, is that encrypted end-to-end as well?

Hi @NanoAkron,

Good question! Anything you send to your core via the HTTPS secured API is sent to your core over an encrypted CoAP session. When you open and send your own packets via custom TCP / UDP sockets, anything you send is going over in the clear, unless you’re encrypting it yourself. This is because TCP / UDP sockets are a lot like plumbing, they’re just making a connection, they don’t bring their own security. You can absolutely bring your own encryption since you have full control, and you can make more secure HTTPS requests with webhooks.

Thanks!
David

So how do I do encryption/decryption on the fly? Is there a library built in? Will the local cloud bring an end-to-end encrypted pathway between my server and my Spark core without relying on the Spark cloud?

Hi @NanoAkron,

TropicSSL ( https://github.com/spark/core-communication-lib/tree/master/lib/tropicssl ) is linked in with the communications library, so you should be able to do the same kinds of AES and RSA encryption operations on the core, but we don’t have a great easy to use example for that yet.

If you’re using the local cloud, then you can write any kind of code running on that machine or elsewhere on the internet, and use the existing secure connection to the core definitely. :slight_smile:

Thanks,
David

Thanks Dave,

A couple more code examples of this sort of stuff in the documentation would be very handy, but I understand you’re still crushing big bugs with OTA/CFOD right now :smile:

1 Like

Hey @NanoAkron,

:slight_smile: I’ll leave myself a note for later to come back to this when we have more bandwidth.

Thanks!
David

1 Like