mchlnix / PyMix

A mix chain implementation in Python using UDP
0 stars 0 forks source link

Add custom CTR start to the channel init message #9

Closed mchlnix closed 6 years ago

mchlnix commented 6 years ago

As of right now, when encrypting a message for a channel, the counter value that is specific to a mix is used as an 8 byte long prefix, with 8 bytes following for the ctr value, that is actually counting up.

For example:

1234 5678 0000 0001
1234 5678 0000 0002
1234 5678 0000 0003
...

Meaning, that billions of values will never be used and that same prefix ctr values will produce same encrypted messages (given that the plain text is also the same).

A bit more variety can be achieved by starting the ctr value not at 0000 0000 but at a fixed random position every time. This fixed starting point could be part of the channel initialization message.

mchlnix commented 6 years ago

This could not be placed in the actual body of the channel initialization message, but would instead be placed next to the symmetric key and ctr prefixes of the mixes, which would make the packets even bigger. The channel initialization message is big enough as it is and since all other data messages need their size to be equal to it, a bigger channel init message means more potentially wasted bandwidth.