particle-iot / spark-server

UNMAINTAINED - An API compatible open source server for interacting with devices speaking the spark-protocol
https://www.particle.io/
GNU Affero General Public License v3.0
442 stars 136 forks source link

Encryption Scheme #43

Closed syslot closed 9 years ago

syslot commented 9 years ago

I hava a question about the encryption scheme spark used (RSA&AES) , why not SSL/TLS, are there some advantages?

zsup commented 9 years ago

Yes, there are significant advantages.

Basically, SSL/TLS have a variety of ciphers that they may use in any given session. This has the advantage of providing compatibility with a wider range of clients. It has two major downsides:

Since we don't need to support client diversity, there's no advantage to SSL/TLS over the encryption we do use. And by only supporting RSA/AES, it significantly decreases the memory overhead (which means we can run on a processor with 20KB of RAM, which would not be possible with SSL/TLS). In addition, it is potentially more secure, because we are not supporting ciphers that might be determined to be insecure.

syslot commented 9 years ago

Thanks for your answer. By the way, in spark server, dose one client map two pairs of keys(the public and private)?

kennethlimcp commented 9 years ago

The device holds its own private key while the server holds the public key as per normal security model.

In additional, communication with the server requires the use of the server public key stored in the device.