state that nonce prepending is normal in NaCl

This commit is contained in:
Matthias Radestock committed 2014-12-12 18:50:09 +00:00
1 parent 5ab6d7bd1f
commit 6b741bef27
1 file changed
+8 -8
+8 -8
View File
@@ -147,14 +147,14 @@ between two peers.
TCP connection are only used to exchange topology information between TCP connection are only used to exchange topology information between
peers, via a message-based protocol. The router generates a fresh peers, via a message-based protocol. The router generates a fresh
192-bit random nonce for every message to be sent, and prepends the 192-bit random nonce for every message to be sent, and prepends the
nonce to the encrypted message so that the receiver knows the nonce to the encrypted message, as is normal in NaCl, so that the
nonce. Encryption of each message is carried out using NaCl's receiver knows the nonce. Encryption of each message is carried out
`secretbox.Seal` function using the ephemeral session key. Each TCP using NaCl's `secretbox.Seal` function using the ephemeral session
connection has a monotonically incrementing message counter, the key. Each TCP connection has a monotonically incrementing message
current value of which is included in the encrypted part of the counter, the current value of which is included in the encrypted part
message. Given the assumption that TCP is reliable and ordered, a of the message. Given the assumption that TCP is reliable and ordered,
message received via TCP is only acted upon if the message counter in a message received via TCP is only acted upon if the message counter
the received message is the expected message counter. This prevents in the received message is the expected message counter. This prevents
replay attacks on the TCP connection. replay attacks on the TCP connection.
As TCP connections do not carry captured traffic, minimising message As TCP connections do not carry captured traffic, minimising message