diff options
author | irungentoo <irungentoo@gmail.com> | 2014-04-22 20:28:40 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-04-22 20:28:40 -0400 |
commit | 1bfe15ee88844bdbd43052b4026202cf924ad6ca (patch) | |
tree | a740f16199cf0a263447e2084dd8906028a7b268 /docs/Tox_middle_level_network_protocol.txt | |
parent | c46ab5821d0fa8c604de52e15009e2b8da5d9c07 (diff) |
Decided pretty much how the handshake would work.
Started writing the code.
Astyled some files.
Diffstat (limited to 'docs/Tox_middle_level_network_protocol.txt')
-rw-r--r-- | docs/Tox_middle_level_network_protocol.txt | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/docs/Tox_middle_level_network_protocol.txt b/docs/Tox_middle_level_network_protocol.txt index ae0fd0f6..be8253cd 100644 --- a/docs/Tox_middle_level_network_protocol.txt +++ b/docs/Tox_middle_level_network_protocol.txt | |||
@@ -38,4 +38,26 @@ from evil "friends" framing relays must also be implemented. | |||
38 | 38 | ||
39 | Detailed implementation details: | 39 | Detailed implementation details: |
40 | 40 | ||
41 | Coming soon. | 41 | cookie request packet: |
42 | [uint8_t 24][Senders DHT Public key (32 bytes)][Random nonce (24 | ||
43 | bytes)][Encrypted message containing: [Senders real public key (32 | ||
44 | bytes)][Recievers real public key (32 bytes)]] | ||
45 | Encrypted message is encrypted with sender DHT private key, recievers DHT public | ||
46 | key and the nonce. | ||
47 | |||
48 | cookie response packet: | ||
49 | [uint8_t 25][Random nonce (24 bytes)][Encrypted message containing: [Cookie]] | ||
50 | Encrypted message is encrypted with sender DHT private key, recievers DHT public | ||
51 | key and the nonce. | ||
52 | |||
53 | The Cookie should be basically: | ||
54 | [nonce][encrypted data:[uint64_t time][Senders real public key (32 | ||
55 | bytes)][Recievers real public key (32 bytes)]] | ||
56 | |||
57 | Handshake packet: | ||
58 | [uint8_t 26][Cookie][nonce][Encrypted message containing: [random 24 bytes base | ||
59 | nonce][session public key of the peer (32 bytes)]] | ||
60 | |||
61 | The handshake packet is encrypted using the real private key of the sender, the | ||
62 | real private key of the reciever and the nonce. | ||
63 | |||