Safest way to update game score from client to server database? Javascript

前端 未结 5 2378
生来不讨喜
生来不讨喜 2020-12-14 10:41

So I have this game that is completely run on the client. No server interaction what so ever apart from downloading the initial scripts to play the game. Anyway at the end o

5条回答
  •  眼角桃花
    2020-12-14 11:19

    Use something like OAuth to authorize the request from client to server. The header contains a token which matches to the body of the request. if these two doesn't match, then discard the request. Don't need to decrypt at server side, instead encrypt the body and check if the result obtained at server side and the token matches the same to find if the body was modified

提交回复
热议问题