Small fixes in the crypto doc.

This commit is contained in:
irungentoo 2013-07-06 11:02:47 -04:00
parent 7458473dca
commit 6a9805d368

View File

@ -43,7 +43,7 @@ Connecting to an already added friend:
As soon as they connect they each generate a new keypair which will only be used for the current connection (The session keys).
They then 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][Senders Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted message containing a random 24 bytes base nonce and the session public key of the peer]
[char with a value of 02][Senders Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted message containing: [random 24 bytes base nonce][session public key of the peer (32 bytes)]]
If the packet is decrypted successfully:
Each start using the secret nonce, the public key provided by the other and their own session private key to encrypt data packets (adding to it + 1 for each packet.)
@ -52,6 +52,7 @@ Connecting to an already added friend:
[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...)
along with the private session key of the reciever.
Every data packet sent is encrypted using the secret nonce we received (with +1 added for the first packet +2 for the second, etc...)
Every data packet sent is encrypted using the secret nonce we received (with +1 added for the first packet +2 for the second, etc...),
the session public key of the reciever and the session private key of the sender.
The encrypted connection is only deemed successful when a data packet is received and decrypted successfully.
The encrypted connection is only deemed successful when the empty data packet is received and decrypted successfully.