4 ms·
RSA encrypt initial handshake message to cloud: https://github.com/spark/core-communication-lib/blob/master/src/spark_protocol.cpp#L102 https://github.com/spark
by towynlin 13y ago
RSA encrypt initial handshake message to cloud:
https://github.com/spark/core-communication-lib/blob/master/src/spark_protocol.cpp#L102 https://github.com/spark/core-communication-lib/blob/master/...
Return message from cloud is decrypted with an RSA private key on the Core:
https://github.com/spark/core-communication-lib/blob/master/src/handshake.cpp#L53 https://github.com/spark/core-communication-lib/blob/master/...
An HMAC signature is verified:
https://github.com/spark/core-communication-lib/blob/master/src/spark_protocol.cpp#L1022 https://github.com/spark/core-communication-lib/blob/master/...
If everything checks out, AES-128-CBC session key is saved and IV is rotated with every message exchanged:
encrypt: https://github.com/spark/core-communication-lib/blob/master/src/spark_protocol.cpp#L989 https://github.com/spark/core-communication-lib/blob/master/...
decrypt: https://github.com/spark/core-communication-lib/blob/master/src/spark_protocol.cpp#L267 https://github.com/spark/core-communication-lib/blob/master/...
Cheers,
Zachary Crockett
Spark CTO
;)
- skue 13y agoThanks!! Please consider adding that some of this to the Security documentation, and more prominent links to the source code as well. I actually found your GitHub profile and should have realized that core-communication-lib is what I wanted, but it appears new and doesn't have many stars yet, so I missed it.
- towynlin 13y agoGreat suggestion! I just added this as a security overview section of the README. https://github.com/spark/core-communication-lib https://github.com/spark/core-communication-lib