I’m working on a singleplayer mobile game.
Currently some of important variables(such as items in possession, money) are stored on the server, but variables related to actual gameplay are handled only on the client. And sadly handling all variables on the server is not an option.
So I guess I should encrypt those variables but I’m not sure how I should do that.
If I encrypt variables which should be able to be read and changed, then that means I also have to store a key(or keys) on the client as well.
However, as a cheater can get his hands on the key, he would just decrypt the variables with the key, change the raw value, and encrypt them. Making the whole encryption redundant.
Hence the question. If I were to use encryption to protect variables on the client, how should I do it? What would be the best practice?
Thanks in advance.