diff options
author | irungentoo <irungentoo@gmail.com> | 2014-04-29 20:45:32 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-04-29 20:45:32 -0400 |
commit | 3863e01e2207198c20bf278c107f24a8cfbf1a73 (patch) | |
tree | a49a417a68d9ccff7dd30824021bc6e1b408795f /docs/Tox_middle_level_network_protocol.txt | |
parent | 94545c3b50c6f87af702692ba171cacc577c669a (diff) |
Some more work done on the middle network protocol.
Handshake most likely has no more possible flaws to it, next thing
to do is to do the same with the data packets.
Wrote a couple more functions.
Diffstat (limited to 'docs/Tox_middle_level_network_protocol.txt')
-rw-r--r-- | docs/Tox_middle_level_network_protocol.txt | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/docs/Tox_middle_level_network_protocol.txt b/docs/Tox_middle_level_network_protocol.txt index 49ad330c..39b275d2 100644 --- a/docs/Tox_middle_level_network_protocol.txt +++ b/docs/Tox_middle_level_network_protocol.txt | |||
@@ -56,10 +56,12 @@ bytes)][Recievers real public key (32 bytes)]] | |||
56 | 56 | ||
57 | Handshake packet: | 57 | Handshake packet: |
58 | [uint8_t 26][Cookie][nonce][Encrypted message containing: [random 24 bytes base | 58 | [uint8_t 26][Cookie][nonce][Encrypted message containing: [random 24 bytes base |
59 | nonce][session public key of the peer (32 bytes)]] | 59 | nonce][session public key of the peer (32 bytes)][sha512 hash of the entire |
60 | Cookie sitting outside the encrypted part][Other Cookie (used by the other to | ||
61 | respond to the handshake packet)]] | ||
60 | 62 | ||
61 | The handshake packet is encrypted using the real private key of the sender, the | 63 | The handshake packet is encrypted using the real private key of the sender, the |
62 | real private key of the reciever and the nonce. | 64 | real private key of the receiver and the nonce. |
63 | 65 | ||
64 | 66 | ||
65 | Alice wants to connect to bob. | 67 | Alice wants to connect to bob. |
@@ -68,15 +70,16 @@ Alice sends a cookie request packet to bob and gets a cookie response back. | |||
68 | 70 | ||
69 | Alice then generates a nonce and a temporary public/private keypair. | 71 | Alice then generates a nonce and a temporary public/private keypair. |
70 | 72 | ||
71 | Alice then takes that nonce and just generated private key and the obtained | 73 | Alice then takes that nonce and just generated private key, the obtained |
72 | cookie and puts them in a handshake packet which she sends to bob. | 74 | cookie, creates a new cookie and puts them in a handshake packet which she |
75 | sends to bob. | ||
73 | 76 | ||
74 | Bob gets the handshake packet, accepts the connection request, then generates a | 77 | Bob gets the handshake packet, accepts the connection request, then generates a |
75 | nonce and a temporary public/private keypair and sends a handshake packet back | 78 | nonce and a temporary public/private keypair and sends a handshake packet back |
76 | with this just generated information and with the cookie field being random | 79 | with this just generated information and with the cookie field being the Other |
77 | data/zeros. | 80 | Cookie contained in the received handshake. |
78 | 81 | ||
79 | Both then use these temporary keys to generate the session key with which every | 82 | Both then use these temporary keys to generate the session key with which every |
80 | data packet sent and recieved will be encrypted and decrypted. The nonce sent | 83 | data packet sent and received will be encrypted and decrypted. The nonce sent |
81 | in the handshake will be used to encrypt the first data packet sent, the nonce | 84 | in the handshake will be used to encrypt the first data packet sent, the nonce |
82 | + 1 the second, the nonce + 2 the third and so on. | 85 | + 1 the second, the nonce + 2 the third and so on. |