Some slight modifications to the crypto protocol.

This commit is contained in:
irungentoo 2013-07-04 18:38:01 -04:00
parent ccb270add2
commit 358f46f648

View File

@ -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...)