ShiVa3D
Secure Some Game data like Score [SOLVED]
All about the StoneScriptSecure Some Game data like Score
by MrGamer » 13 Jul 2012, 11:19
Hi
In my game I need security on game score. Is there any good way to keep score safe so no one can change it without getting it by playing game. I also need to secure it even at runtime because there is some application like cheat engine which can change the values inside RAM. Any good suggestions for it.
In my game I need security on game score. Is there any good way to keep score safe so no one can change it without getting it by playing game. I also need to secure it even at runtime because there is some application like cheat engine which can change the values inside RAM. Any good suggestions for it.
Play game win cash prize
http://moneybackapps.com/
https://play.google.com/store/apps/developer?id=Money+Back+Apps
http://moneybackapps.com/
https://play.google.com/store/apps/developer?id=Money+Back+Apps
Re: Secure Some Game data like Score [SOLVED]
by Fraser » 13 Jul 2012, 13:03
To stop casual tampering then could do this:
store score in xml elements.
element[1]
the raw score number as a string
elements[2]...[5]
take the raw score and apply a different math transform to each one.
Then when you read the score do inverse math transforms on [2]...[5] and check that they all fall within limits of real score [1] to validate.
You can use any transform provided you can code both foward and reverse transform
Increase the number of encoded elements to harden it up.
Transforms can be this (or more complex):
FORWARD
OUT = (IN * K + L) / M
INVERSE
OUT = (IN * M) / K - L
You could use a loop to generate lots of extra elements and have it change K,L,M as it progresses. Do same for the inverse check.
For better hardness then generate a long token from the score using CRC.
EDIT:
As for preventing RAM altering from cheat engine then you would have to wrap your built executable in some security wrapper, depending on your target platform. But nothing is perfect.
What is your plan, cash prize for first player to score X or something.
EDIT:
Changed SSL to CRC
store score in xml elements.
element[1]
the raw score number as a string
elements[2]...[5]
take the raw score and apply a different math transform to each one.
Then when you read the score do inverse math transforms on [2]...[5] and check that they all fall within limits of real score [1] to validate.
You can use any transform provided you can code both foward and reverse transform
Increase the number of encoded elements to harden it up.
Transforms can be this (or more complex):
FORWARD
OUT = (IN * K + L) / M
INVERSE
OUT = (IN * M) / K - L
You could use a loop to generate lots of extra elements and have it change K,L,M as it progresses. Do same for the inverse check.
For better hardness then generate a long token from the score using CRC.
EDIT:
As for preventing RAM altering from cheat engine then you would have to wrap your built executable in some security wrapper, depending on your target platform. But nothing is perfect.
What is your plan, cash prize for first player to score X or something.
EDIT:
Changed SSL to CRC
Last edited by Fraser on 13 Jul 2012, 17:31, edited 1 time in total.
Fraser,
http://www.silicondroid.com
http://www.silicondroid.com
Re: Secure Some Game data like Score
by freezer » 13 Jul 2012, 15:19
my first thought was to use a hash function to use as a check back.
heres a simple one...
http://en.wikipedia.org/wiki/Computation_of_CRC#Implementation
and a quick search for "crc lua" threw out some examples... e.g.
http://luamemcached.googlecode.com/svn/trunk/CRC32.lua
p.s. crc32 will have collisions since it's quite simple...
heres a simple one...
http://en.wikipedia.org/wiki/Computation_of_CRC#Implementation
and a quick search for "crc lua" threw out some examples... e.g.
http://luamemcached.googlecode.com/svn/trunk/CRC32.lua
p.s. crc32 will have collisions since it's quite simple...
- freezer
- Gold Boarder

- Posts: 164
Re: Secure Some Game data like Score
by makkar » 13 Jul 2012, 16:11
Why don't you think about using local environment variables? They are by default securely stored on the device.
Re: Secure Some Game data like Score
by MrGamer » 13 Jul 2012, 16:36
Thanks for your answers
in our game we want to lock our levels according to points. SO if somebody reach on a score limit then player can play next level. So we are looking a such method so no one can unlock level without playing it.
Your idea of local environment variables id good to save score when player exit game but we also need a way so player cannot change it from RAM. So if data will be cahnged from RAM then same data will be saved on environment variables.
I thing Fraser idea may be work.

in our game we want to lock our levels according to points. SO if somebody reach on a score limit then player can play next level. So we are looking a such method so no one can unlock level without playing it.
makkar wrote:Why don't you think about using local environment variables? They are by default securely stored on the device.
Your idea of local environment variables id good to save score when player exit game but we also need a way so player cannot change it from RAM. So if data will be cahnged from RAM then same data will be saved on environment variables.
I thing Fraser idea may be work.
Play game win cash prize
http://moneybackapps.com/
https://play.google.com/store/apps/developer?id=Money+Back+Apps
http://moneybackapps.com/
https://play.google.com/store/apps/developer?id=Money+Back+Apps
Re: Secure Some Game data like Score
by Fraser » 13 Jul 2012, 17:23
A "hard" security wrapper for PC exes does cost you, "software passport" is probably the hardest commercially available.
I'm curious as to why you need to protect the levels completed variable so fiercely?
I'm curious as to why you need to protect the levels completed variable so fiercely?
Fraser,
http://www.silicondroid.com
http://www.silicondroid.com
Re: Secure Some Game data like Score
by MrGamer » 13 Jul 2012, 19:09
Thanks a lot everyone.
I can mix Fraser and makkar suggestion and can solve my problem.
Both are helpful.

I can mix Fraser and makkar suggestion and can solve my problem.
Both are helpful.
Play game win cash prize
http://moneybackapps.com/
https://play.google.com/store/apps/developer?id=Money+Back+Apps
http://moneybackapps.com/
https://play.google.com/store/apps/developer?id=Money+Back+Apps
Re: Secure Some Game data like Score
by freezer » 29 Jul 2012, 22:23
- freezer
- Gold Boarder

- Posts: 164
8 posts
• Page 1 of 1

