★ TouchArcade needs your help. Click here to support us on Patreon.

Preventing Cheaters

02-27-2011, 10:25 PM
#1
Joined: Mar 2010
Location: Estero, FL
Posts: 221
02-27-2011, 10:32 PM
#2
Joined: Dec 2008
Location: Sacramento, CA
Posts: 4,568
So what stops them from editing the text file anyway, putting in 1,000,000 and then the game decoding that back into 605,578?


Highscore = ((1000000 - 829) / 1.65) + 20 // decoded back to 605,578

Then they realize, the score gets lowered for some reason after entering it. So they just enter in a bigger number next time they hack and their score then increases again.

Twitter: @Zincous

02-27-2011, 10:37 PM
#3
Joined: Mar 2010
Location: Estero, FL
Posts: 221
Sorry I forgot to mention. All you do is save the original value of the highscore from the game along with the encoded value, but don't use it. Just compare the decoded score against the original and if they don't match..well you get the idea
02-27-2011, 10:59 PM
#4
Joined: Jul 2010
Posts: 1,913
you do realize you cannot hack your highscore, so that it will be displayed online. Someone could just change both value to the same value. You method is not fail-proof as we can just input numbers and test it out. There are much easier ways to hack a game.
02-27-2011, 11:02 PM
#5
Joined: Nov 2010
Location: alea iacta est
Posts: 1,368
Too easily hackable even if you do the above step. Wouldn't a hacker just change both? And games can only save files in a few selected places, a hacker will look in all of them. Encrypt the entire save file, and use an encryption method that generates lots of random numbers (i.e. 3000=56, 56=9001, ect). But you also have to make it so that not every output variable equals an actual number; ie, if the output variable is 3141, that doesn't equate to any high score. Otherwise I could just put in a few different numbers and see which one is highest. And if I had enough time I could create a rainbow table, or just make a script to run through all of the numbers, or look through your code to see as it has to be unencrypted before you can load it.

PS. If you're using algorithms as simple as that, anyone with a basic understanding of linear algebra (8th grade) would be able to crack your equation.
02-27-2011, 11:34 PM
#6
Joined: Mar 2010
Location: Estero, FL
Posts: 221
I'm sorry I'm not sure if I explained everything clearly.yes the value would be crackable if you know 8th grade algebra but only if you know the values 1.65, 829, and 20. Plus you can use any math you want, I was just providing a simple example. If the game compares the value of the original score to the decoded score, and turnes out they don't match, you could reset the high score to 0 if you want. Okay here's another example. Imagine this being in a text file:

high score 2310

encoded high score 69340

If you can figure out what the equation is by knowing only those values, let me know. but if the cheater tries to change the values randomly and they don't match, the game doesn't accept the highscore and can reset it to 0.
02-28-2011, 12:14 AM
#7
Joined: Nov 2010
Location: alea iacta est
Posts: 1,368
I'm going to get a few more highscores normally, let's use 3000 for this example. I'm going to form the equation (3000-x)/y+z=encrypted high score, convert it to Y= form, and run it through a 3D grapher. Then I'll do it for numerous other high scores. Where everything intersects is the values of x, y and z. Then I add the values of x, y, and z into the original equation and I can get normal and encrypted high scores for any number.
02-28-2011, 12:30 AM
#8
Joined: Mar 2010
Posts: 404
Quote:
Originally Posted by bcarbone View Post
I'm sorry I'm not sure if I explained everything clearly.yes the value would be crackable if you know 8th grade algebra but only if you know the values 1.65, 829, and 20. Plus you can use any math you want, I was just providing a simple example. If the game compares the value of the original score to the decoded score, and turnes out they don't match, you could reset the high score to 0 if you want. Okay here's another example. Imagine this being in a text file:

high score 2310

encoded high score 69340

If you can figure out what the equation is by knowing only those values, let me know. but if the cheater tries to change the values randomly and they don't match, the game doesn't accept the highscore and can reset it to 0.
give me 2 more sets and my 7th grade cousins could figure it out.

~uıʌoןɔɯ
Want list: Oh! Edo Towns , Space Tripper,
02-28-2011, 12:31 AM
#9
Joined: Mar 2010
Location: Estero, FL
Posts: 221
BUT how does the cheater know the form of the equation?? FYI the last example was ((2310 + 19) * 30) - 530). It could be in any form! I can add square roots if I wanted to. But as long as you do not know the form of the equation you cannot solve the values. and without the values of the equation it's very difficult to cheat. Sounds like a lot of work just to hack a number that represents your high score in a simple video game huh?
02-28-2011, 12:34 AM
#10
Joined: Mar 2010
Location: Estero, FL
Posts: 221
Quote:
Originally Posted by dxfan101010 View Post
give me 2 more sets and my 7th grade cousins could figure it out.
That was completely unhelpful and irrelevent.