summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-12-23 16:21:07 -0500
committerirungentoo <irungentoo@gmail.com>2013-12-23 16:21:07 -0500
commit01949b6a679d4949735972283284309d8caef0bd (patch)
treed56ee47bb6b6a8f76663639c0b1f95737f53ce9e /docs
parenta55437a2205a39f48ee87ec07114e15ebf564aba (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.txt141
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 @@
1Current privacy issues with the Tox DHT:
2
31. It makes tracking people across different IPs very easy.
4Solution: Have each new DHT use a temporary public/private key pair not related
5to the long term public/private key pair.
6
72. Metadata on which key is friends to which can be collected (The hardening
8makes this somewhat harder by introducing a bunch of random traffic but not
9impossible.).
10Solution: If no long term keys were used in the DHT it would solve this
11problem. (possibly knowing which ip is connected to which is much less
12precious.)
13
14
15So, it seems all our privacy problems are solved if we can manage to make every
16node in the DHT have a keypair that is not related to the long term keys and is
17generated every session.
18
19
20So, every node in the DHT now has a temporary keypair not related to their real
21long term one.
22
23But, how do people find themselves then? We have to add a way for people to
24tell their friends what their DHT public key is, we also have to somehow make
25it so people can send/receive friend requests, this has to be done without non
26friends being able to find out where a node is.
27
28The solution: Onion routing + enable the storage of some small amount of data
29on
30DHT nodes.
31
32
33Alice and bob are friends, before joining the DHT they generate temporary
34session keypairs to be used for the DHT instead of their long term keys.
35
36Bob finds a bunch of random nodes then picks 3 random working ones (A, B, C).
37
38Bob gets the know working node with an id closest to his real one from his list (D)
39
40Bob then creates an onion (the packet will go through A, B, C and will end up at D)
41announce request packet with his real public key, ping_id as zeros and
42searching for his real public key.
43
44Bob will announce response packets and will recursively send onion announce request packets
45to closer and closer nodes until he finds the ones closest to his real public key.
46
47Once he has done this, he will send some onion announce request packets with the right ping_id previously
48received from the node when he queried it to announce himself to the node.
49
50The nodes he announces himself to keep the information to send onion packets to that node in memory.
51
52Alice meanwhile searches for the Nodes closest to Bobs real id using a temporary keypair and announce
53request packets, she does this until she finds nodes that respond with a ping_id of zero.
54
55She 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
58Bob finds her by using her temporary id and they connect to each other.
59
60
61NOTE: crypto_box is used for all the asymmetric encryption and crypto_secretbox is used for all the symmetric.
62Also every DHT node have a random symmetric key which they use to encrypt the stuff in normal get node request that is
63used to encrypt stuff in the following.
64
65Onion packet (request):
66
67initial (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)]
87encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)]
88encrypted 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)]
93encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)]
94encrypted with temp symmetric key of Node A: [IP_Port (of us)]]]
95
96Data sent to Node D:
97
98announce request packet:
99[uint8_t packet id (131)][nonce][our real long term public key or a temporary one (see next)]
100encrypted (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,
104add the part used to send data to our list (if the list is full make it replace the furthest entry))
105
106data 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
110Data sent to us:
111announce response packet:
112[uint8_t packet id (132)][nonce]
113encrypted 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
116data to route response packet:
117[uint8_t packet id (134)][nonce]encrypted with that temporary private key and the nonce:[data]
118
119Onion packet (response):
120
121initial (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)]
125encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)]
126encrypted 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)]
131encrypted with temp symmetric key of Node B:[IP_Port (of Node A)[nonce (for the following symmetric encryption)]
132encrypted 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)]
137encrypted 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]