From 212bb8beba10951c0db8cf98b3fd5dfe6b76e27e Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 23 Jul 2015 01:40:39 +0200 Subject: [PATCH] Added crypto information to protocol (fixes #17). --- PROTOCOL.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index dcd8cdd..8ba8140 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -26,13 +26,37 @@ address as hash. Additionally, nodes MUST NOT connect to a node with either address. +Crypto +------ + +Every node has a 4096 RSA key pair that is used for message signing +and encryption. + +All messages are signed with 'SHA256withRSA'. The signature is written +to the 'Encryption Data' part. + +Content messages are encrypted using a random 256 bit AES key. The +key is then wrapped using RSA with the sender's private key, and +written to the 'Encryption Data' part. + +The node address is the output of 'SHA-256' on the private key. + + Routing ------- -A simple flood routing protocol is currently used. Every node forwards all messages, unless a message with the same Origin and Sequence Number has already been received. +A simple flood routing protocol is currently used. Every node forwards +all messages, unless a message with the same Origin and Sequence Number +has already been received. -Nodes MUST store pairs of (Origin, Sequence Number) for all received messages. After receiving a new message, entries with the same Origin and Sequence Number between _received_ + 1 and _received_ + 32767 MUST be removed (with a wrap around at the maximum value). The entries MUST NOT be cleared while the program is running. They MAY be cleared when the program is exited. +Nodes MUST store pairs of (Origin, Sequence Number) for all received +messages. After receiving a new message, entries with the same Origin +and Sequence Number between _received_ + 1 and _received_ + 32767 MUST +be removed (with a wrap around at the maximum value). The entries MUST +NOT be cleared while the program is running. They MAY be cleared when +the program is exited. -There is currently no support for offline messages. If sender and receiver are not in the same mesh, the message will not arrive. +There is currently no support for offline messages. If sender and +receiver are not in the same mesh, the message will not arrive. Nodes are free implement different routing algorithms.