From 358f46f6483f0c24186272914952e44221c76871 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 4 Jul 2013 18:38:01 -0400 Subject: Some slight modifications to the crypto protocol. --- docs/Crypto.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Crypto.txt b/docs/Crypto.txt index 3abfe82e..0f7d42da 100644 --- a/docs/Crypto.txt +++ b/docs/Crypto.txt @@ -40,11 +40,12 @@ only crypto_box() is used for encryption and only crypto_box_open() for decrypti Connecting to an already added friend: Alice and Bob are friends. - As soon as they connect they each send themselves the following packet (encrypted part encrypted with the public nonce in the packet + As soon as they connect they each send themselves the following packet (the crypto handshake) (encrypted part encrypted with the public nonce in the packet the public key of the receiver and private key of the sender) - [char with a value of 02][Random nonce (24 bytes)][Encrypted message containing a random 24 bytes base nonce] + [char with a value of 02][Senders Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted message containing a random 24 bytes base nonce] If the packet is decrypted successfully: Each start using the secret nonce provided by the other to encrypt data packets (adding to it + 1 for each packet.) + Each node sends themselves an empty data packet (data packet with 4 encrypted zero bytes) Data packet: [char with a value of 03][Encrypted data] Each data packet received it is decrypted using the secret nonce sent to the other(with +1 added for the first packet +2 for the second, etc...) -- cgit v1.2.3