summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-06-06 23:05:35 -0400
committerirungentoo <irungentoo@gmail.com>2014-06-06 23:05:35 -0400
commitd540d9f4261dc916c330604a607897ae4c31df0c (patch)
tree1deffa1babe67c4bb8e68684bed63d4db2487dc3 /docs
parent7adefb6e6bc22eb3e68b4acc754a401caccffb4f (diff)
Updated outdated crypto doc.
Diffstat (limited to 'docs')
-rw-r--r--docs/updates/Crypto.md27
1 files changed, 2 insertions, 25 deletions
diff --git a/docs/updates/Crypto.md b/docs/updates/Crypto.md
index 939c15e2..cee03f0a 100644
--- a/docs/updates/Crypto.md
+++ b/docs/updates/Crypto.md
@@ -1,6 +1,3 @@
1Draft proposal for how crypto will be implemented.
2
3
4Encryption library used: http://nacl.cr.yp.to/ 1Encryption library used: http://nacl.cr.yp.to/
5 2
6 3
@@ -9,8 +6,6 @@ generate the users public-private key pair. (32 bytes each)
9 6
10The generated public key is set as the client_id of the peer. 7The generated public key is set as the client_id of the peer.
11 8
12Note that only the crypto connection runs on top of Lossless UDP. The friend requests do not.
13
14Adding a friend 9Adding a friend
15--------------- 10---------------
16 11
@@ -27,7 +22,7 @@ Alice sends a onion data (see: Prevent_tracking.txt) packet to bob with the encr
27 22
28Ex message: hello bob it's me alice -_- add me pl0x. 23Ex message: hello bob it's me alice -_- add me pl0x.
29 24
30For more info on the nospam see: [[Spam Prevention]] 25For more info on the nospam see: Spam_Prevention.txt
31 26
32Bob receives the request and decrypts the message using the function crypto_box_open() 27Bob receives the request and decrypts the message using the function crypto_box_open()
33 28
@@ -45,25 +40,7 @@ In the next step only crypto_box() is used for encryption and only crypto_box_op
45Connecting to an already added friend 40Connecting to an already added friend
46------------------------------------- 41-------------------------------------
47 42
48Alice and Bob are friends. 43see: Tox_middle_level_network_protocol.txt
49As soon as they connect they each generate a new keypair which will only be used for the current connection (The session keys).
50They 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)
51```
52[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)]]
53```
54
55If the packet is decrypted successfully:
56Each 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.)
57Each node sends themselves an empty data packet (data packet with 4 encrypted zero bytes)
58Data packet:
59````
60[char with a value of 03][Encrypted data]
61````
62Each data packet received 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 receiver.
63Every 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 receiver and the session private key of the sender.
64
65The encrypted connection is only deemed successful when the empty data packet is received and decrypted successfully.
66
67 44
68Crypto request packets 45Crypto request packets
69-------------------------------------- 46--------------------------------------