diff options
Diffstat (limited to 'docs/Crypto.txt')
-rw-r--r-- | docs/Crypto.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/Crypto.txt b/docs/Crypto.txt index 817c1472..11653616 100644 --- a/docs/Crypto.txt +++ b/docs/Crypto.txt | |||
@@ -43,7 +43,7 @@ Connecting to an already added friend: | |||
43 | As soon as they connect they each generate a new keypair which will only be used for the current connection (The session keys). | 43 | As soon as they connect they each generate a new keypair which will only be used for the current connection (The session keys). |
44 | They then send themselves the following packet (the crypto handshake) (encrypted part encrypted with the public nonce in the packet | 44 | They then send themselves the following packet (the crypto handshake) (encrypted part encrypted with the public nonce in the packet |
45 | the public key of the receiver and private key of the sender) | 45 | the public key of the receiver and private key of the sender) |
46 | [char with a value of 02][Senders Public key (client_id) (32 bytes)][Random nonce (24 bytes)][Encrypted message containing a random 24 bytes base nonce and the session public key of the peer] | 46 | [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)]] |
47 | 47 | ||
48 | If the packet is decrypted successfully: | 48 | If the packet is decrypted successfully: |
49 | Each 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.) | 49 | Each 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.) |
@@ -52,6 +52,7 @@ Connecting to an already added friend: | |||
52 | [char with a value of 03][Encrypted data] | 52 | [char with a value of 03][Encrypted data] |
53 | Each data packet received it is decrypted using the secret nonce sent to the other(with +1 added for the first packet +2 for the second, etc...) | 53 | Each data packet received it is decrypted using the secret nonce sent to the other(with +1 added for the first packet +2 for the second, etc...) |
54 | along with the private session key of the reciever. | 54 | along with the private session key of the reciever. |
55 | Every data packet sent is encrypted using the secret nonce we received (with +1 added for the first packet +2 for the second, etc...) | 55 | Every data packet sent is encrypted using the secret nonce we received (with +1 added for the first packet +2 for the second, etc...), |
56 | the session public key of the reciever and the session private key of the sender. | 56 | the session public key of the reciever and the session private key of the sender. |
57 | The encrypted connection is only deemed successful when a data packet is received and decrypted successfully. | 57 | |
58 | The encrypted connection is only deemed successful when the empty data packet is received and decrypted successfully. | ||