ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/doc/gvpe.protocol.7.pod
(Generate patch)

Comparing gvpe/doc/gvpe.protocol.7.pod (file contents):
Revision 1.14 by root, Sat Apr 26 19:07:22 2014 UTC vs.
Revision 1.15 by root, Thu Jan 29 00:21:39 2015 UTC

134 134
135The DATA portion differs between each packet type, naturally, and is the 135The DATA portion differs between each packet type, naturally, and is the
136only part that can be encrypted. Data packets contain more fields, as 136only part that can be encrypted. Data packets contain more fields, as
137shown: 137shown:
138 138
139 +------+------+--------+------+-------+------+ 139 +------+------+--------+-------+------+
140 | HMAC | TYPE | SRCDST | RAND | SEQNO | DATA | 140 | HMAC | TYPE | SRCDST | SEQNO | DATA |
141 +------+------+--------+------+-------+------+ 141 +------+------+--------+-------+------+
142
143RAND is a sequence of fully random bytes, used to increase the entropy of
144the data for encryption purposes.
145 142
146SEQNO is a 32-bit sequence number. It is negotiated at every connection 143SEQNO is a 32-bit sequence number. It is negotiated at every connection
147initialization and starts at some random 31 bit value. GVPE currently uses 144initialization and starts at some random 31 bit value. GVPE currently uses
148a sliding window of 512 packets/sequence numbers to detect reordering, 145a sliding window of 512 packets/sequence numbers to detect reordering,
149duplication and replay attacks. 146duplication and replay attacks.
150 147
151The encryption is done on RAND+SEQNO+DATA in CBC mode with zero IV (or, 148The encryption is done on SEQNO+DATA in CTR mode with IV generated from
152equivalently, the IV is RAND+SEQNO, encrypted with the block cipher, 149the seqno (for AES: seqno || seqno || seqno || (u32)0), which ensures
153unless RAND size is decreased or increased over the default value). 150uniqueness for a given key.
154
155The random prefix itself is generated by using AES in CTR mode with a
156random key and starting value, which should make them unpredictable even
157before encrypting them again. The sequence number additionally ensures
158that the IV is unique.
159 151
160=head2 The authentication/key exchange protocol 152=head2 The authentication/key exchange protocol
161 153
162Before nodes can exchange packets, they need to establish authenticity of 154Before nodes can exchange packets, they need to establish authenticity of
163the other side and a key. Every node has a private RSA key and the public 155the other side and a key. Every node has a private RSA key and the public

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines