diff options
author | irungentoo <irungentoo@gmail.com> | 2013-12-23 16:21:07 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-12-23 16:21:07 -0500 |
commit | 01949b6a679d4949735972283284309d8caef0bd (patch) | |
tree | d56ee47bb6b6a8f76663639c0b1f95737f53ce9e /docs | |
parent | a55437a2205a39f48ee87ec07114e15ebf564aba (diff) |
Added proposal on how to solve all the privacy related problems with the DHT.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Prevent_Tracking.txt | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/docs/Prevent_Tracking.txt b/docs/Prevent_Tracking.txt new file mode 100644 index 00000000..eb8db794 --- /dev/null +++ b/docs/Prevent_Tracking.txt | |||
@@ -0,0 +1,141 @@ | |||
1 | Current privacy issues with the Tox DHT: | ||
2 | |||
3 | 1. It makes tracking people across different IPs very easy. | ||
4 | Solution: Have each new DHT use a temporary public/private key pair not related | ||
5 | to the long term public/private key pair. | ||
6 | |||
7 | 2. Metadata on which key is friends to which can be collected (The hardening | ||
8 | makes this somewhat harder by introducing a bunch of random traffic but not | ||
9 | impossible.). | ||
10 | Solution: If no long term keys were used in the DHT it would solve this | ||
11 | problem. (possibly knowing which ip is connected to which is much less | ||
12 | precious.) | ||
13 | |||
14 | |||
15 | So, it seems all our privacy problems are solved if we can manage to make every | ||
16 | node in the DHT have a keypair that is not related to the long term keys and is | ||
17 | generated every session. | ||
18 | |||
19 | |||
20 | So, every node in the DHT now has a temporary keypair not related to their real | ||
21 | long term one. | ||
22 | |||
23 | But, how do people find themselves then? We have to add a way for people to | ||
24 | tell their friends what their DHT public key is, we also have to somehow make | ||
25 | it so people can send/receive friend requests, this has to be done without non | ||
26 | friends being able to find out where a node is. | ||
27 | |||
28 | The solution: Onion routing + enable the storage of some small amount of data | ||
29 | on | ||
30 | DHT nodes. | ||
31 | |||
32 | |||
33 | Alice and bob are friends, before joining the DHT they generate temporary | ||
34 | session keypairs to be used for the DHT instead of their long term keys. | ||
35 | |||
36 | Bob finds a bunch of random nodes then picks 3 random working ones (A, B, C). | ||
37 | |||
38 | Bob gets the know working node with an id closest to his real one from his list (D) | ||
39 | |||
40 | Bob then creates an onion (the packet will go through A, B, C and will end up at D) | ||
41 | announce request packet with his real public key, ping_id as zeros and | ||
42 | searching for his real public key. | ||
43 | |||
44 | Bob will announce response packets and will recursively send onion announce request packets | ||
45 | to closer and closer nodes until he finds the ones closest to his real public key. | ||
46 | |||
47 | Once he has done this, he will send some onion announce request packets with the right ping_id previously | ||
48 | received from the node when he queried it to announce himself to the node. | ||
49 | |||
50 | The nodes he announces himself to keep the information to send onion packets to that node in memory. | ||
51 | |||
52 | Alice meanwhile searches for the Nodes closest to Bobs real id using a temporary keypair and announce | ||
53 | request packets, she does this until she finds nodes that respond with a ping_id of zero. | ||
54 | |||
55 | She sends data to route request packet with information telling Bob her temporary id in the DHT | ||
56 | (or a friend request if she is not friends with him). | ||
57 | |||
58 | Bob finds her by using her temporary id and they connect to each other. | ||
59 | |||
60 | |||
61 | NOTE: crypto_box is used for all the asymmetric encryption and crypto_secretbox is used for all the symmetric. | ||
62 | Also every DHT node have a random symmetric key which they use to encrypt the stuff in normal get node request that is | ||
63 | used to encrypt stuff in the following. | ||
64 | |||
65 | Onion packet (request): | ||
66 | |||
67 | initial (sent from us to node A): | ||
68 | |||
69 | [uint8_t packet id (128)][nonce] | ||
70 | [our temp DHT public key]encrypted with our temp DHT private key and the pub key of Node A and the nonce:[ | ||
71 | [IP_Port of node B][a random public key]encrypted with the random private key and the pub key of Node B and the nonce:[ | ||
72 | [IP_Port of node C][a random public key]encrypted with the random private key and the pub key of Node C and the nonce:[ | ||
73 | [IP_Port of node D][data to send to Node D]]]] | ||
74 | |||
75 | (sent from node A to node B): | ||
76 | |||
77 | [uint8_t packet id (129)][nonce] | ||
78 | [a random public key]encrypted with the random private key and the pub key of Node B and the nonce:[ | ||
79 | [IP_Port of node C][a random public key]encrypted with the random private key and the pub key of Node C and the nonce:[ | ||
80 | [IP_Port of node D][data to send to Node D]]][nonce (for the following symmetric encryption)]encrypted with temp symmetric key of Node A: [IP_Port (of us)] | ||
81 | |||
82 | (sent from node B to node C): | ||
83 | |||
84 | [uint8_t packet id (130)][nonce] | ||
85 | [a random public key]encrypted with the random private key and the pub key of Node C and the nonce:[ | ||
86 | [IP_Port of node D][data to send to Node D]][nonce (for the following symmetric encryption)] | ||
87 | encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)] | ||
88 | encrypted with temp symmetric key of Node A: [IP_Port (of us)]] | ||
89 | |||
90 | (sent from node C to node D): | ||
91 | [data to send to Node D][nonce (for the following symmetric encryption)]encrypted with temp symmetric key of Node C: | ||
92 | [IP_Port (of Node B)[nonce (for the following symmetric encryption)] | ||
93 | encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)] | ||
94 | encrypted with temp symmetric key of Node A: [IP_Port (of us)]]] | ||
95 | |||
96 | Data sent to Node D: | ||
97 | |||
98 | announce request packet: | ||
99 | [uint8_t packet id (131)][nonce][our real long term public key or a temporary one (see next)] | ||
100 | encrypted (with our real long term private key if we want to announce ourselves, a temporary one if we are searching for friends) and the pub key of Node D and the nonce:[[(32 bytes) ping_id][client id we are searching for]] | ||
101 | |||
102 | (if the ping id is zero, respond with a announce response packet) | ||
103 | (If the ping id matches the one the node sent in the announce response and the public key matches the one being searched for, | ||
104 | add the part used to send data to our list (if the list is full make it replace the furthest entry)) | ||
105 | |||
106 | data to route request packet: | ||
107 | [uint8_t packet id (133)][public key of destination node][nonce][temporary just generated public key]encrypted with that temporary private key and the nonce:[data] | ||
108 | (if Node D contains the used to send data for, it sends the stuff in this packet as a data to route response packet to the right node) | ||
109 | |||
110 | Data sent to us: | ||
111 | announce response packet: | ||
112 | [uint8_t packet id (132)][nonce] | ||
113 | encrypted with the DHT private key of Node D, our long term public key and the nonce:[[(32 bytes) ping_id][Node_Format * (maximum of 8)]] | ||
114 | (if the ping id is zero, it means the client id we are searching for is stored on ) | ||
115 | |||
116 | data to route response packet: | ||
117 | [uint8_t packet id (134)][nonce]encrypted with that temporary private key and the nonce:[data] | ||
118 | |||
119 | Onion packet (response): | ||
120 | |||
121 | initial (sent from node D to node C): | ||
122 | |||
123 | [uint8_t packet id (140)][nonce (for the following symmetric encryption)]encrypted with temp symmetric key of Node C: | ||
124 | [IP_Port (of Node B)[nonce (for the following symmetric encryption)] | ||
125 | encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)] | ||
126 | encrypted with temp symmetric key of Node A: [IP_Port (of us)]]][data to send back] | ||
127 | |||
128 | (sent from node C to node B): | ||
129 | |||
130 | [uint8_t packet id (141)][nonce (for the following symmetric encryption)] | ||
131 | encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)] | ||
132 | encrypted with temp symmetric key of Node A: [IP_Port (of us)]][data to send back] | ||
133 | |||
134 | (sent from node B to node A): | ||
135 | |||
136 | [uint8_t packet id (142)][nonce (for the following symmetric encryption)] | ||
137 | encrypted with temp symmetric key of Node A: [IP_Port (of us)][data to send back] | ||
138 | |||
139 | (sent from node A to us): | ||
140 | |||
141 | [uint8_t packet id (143)][data to send back] | ||