How to check if the sender of a udp packet is authenticated? I think sending an authorization token in each packet is slow. So my second implementation is this: the network part will consist of one server and clients. Using the TCP, the client logs in to the server and receives the secret session key and the ID of the client's account (himself). Then, in every udp request to the server, the client should be able to insert the unencrypted ID at the beginning of the packet and encrypt the rest of the packet (the payload) with the secret key. And the server would already look for the secret key by the client's ID and decrypt the message. It turns out a kind of authentication. If you send id + unencrypted data, then after decrypting, the server will receive incorrect data and therefore will not process the request. But in this method, it takes time to transfer the ID and decrypt/encrypt the data. Is there a safe way to prevent this?
UDP authentication
olegshmel
- 1
- 1