LLAPI - Does UNet add a "Security ID" in front of packets to prevent things like IP Spoofing?

I am just wondering if unity does anything in regards to making sure a packet from a connection is indeed from that connection.

I ask because currently I plan on placing a random 4 byte “Security ID” in front of all my packets that is different per connection so that each connection can somewhat verify who they are talking to. Its not perfect, but should be fine for a simple game.
However, if unet already does something like this then I am just wasting bytes.

yes , each packet contains random session id 2 bytes long

Ah, thanks =)

Would it be possible to have the option to make it 4 or 8 bytes long, i feel 2 might be too low?

Also, how is it randomly generated? Is it with something advance like c# RNGCryptoServiceProvider for a stronger random value?

Would it be possible to have the option to make it 4 or 8 bytes long, i feel 2 might be too low?
So far no, size is hardcoded in the header.

No it is not crypto generated.

We are going to add sodium (security lib) and i will add this feature then we will consider better protocol security. When we will do this? I hope before end of this year :frowning:

2 Likes

Alright, its not too much of a big deal since I already have the code in place to add my own security id, but its nice to know there is already a 2 byte security id built in.
Thanks =)