I'm creating a real time multiplayer game. Each piece of data needs to be received, but it still needs to be as fast as possible which is why I don't want to use TLS for every request.
Here's what I was thinking:
The player logs in using TLS, and receives a session ID and symmetric key that the server generates
The server stores the player's ip address and symmetric key in the database for future reference
When they start a match, they receive a match ID, and send data to the server including the match ID, their session ID, and any necessary data using a symmetric encryption algorithm
The server takes their IP, finds the symmetric key from the database, and decrypts the message and authenticates the user based on the session ID
If everything checks out, the server accepts the data.
Is this approach plausible/efficient? would it be better for me to store the each player's symmetric key using their IP, or for me to get rid of the IP/symmetric key link table and send the data with the session id not encrypted, and store the key using the session id?
Any answers/comments would be greatly appreciated.