multiplayer-community-contributions icon indicating copy to clipboard operation
multiplayer-community-contributions copied to clipboard

feat: add ChaCha20 crypto transport

Open TwoTenPvP opened this issue 4 years ago • 4 comments

TwoTenPvP avatar Apr 09 '21 13:04 TwoTenPvP

Two things not yet finished:

  1. IV and Counter has to be reset for every packet. Otherwise we will get a keystream mismatch when a packet goes out of order or go missing.
  2. There is not yet a validation handler for certificates. All certificates are blindly just "accepted".

Both these things should be fixed before we merge this. But it's a good starting point for crypto. I will get to this once I have time. Just thought it still might be useful as a PR in the meantime.

TwoTenPvP avatar Apr 09 '21 14:04 TwoTenPvP

Counter synchronization is now implemeneted. You can have anywhere between 64-128 blocks of loss or reordering before things break.

This could be massively improved by using some of the first header byte to store a slightly larger counter (just a few bits would make a huge difference). This however requires custom int rollover so will have to be future developments.

A cert handler is also implemented and required when using signed handshakes.

TwoTenPvP avatar Oct 29 '21 19:10 TwoTenPvP

Had to retarget this at main so that we can delete the master branch.

LukeStampfli avatar Nov 26 '21 09:11 LukeStampfli

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

unity-cla-assistant avatar Sep 07 '22 08:09 unity-cla-assistant