Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a hack proof game in Javascript [closed]

Suppose you created an online game in HTML5/JavaScript. All the code would be downloaded into the user's browser, and they would run the game.

How do you stop someone from copying the game onto their computer, and injecting functions and modules to cheat? For example, they could write a function that auto-aims at the nearest enemy sprite for example.

Is there any fundamental way to protect people from doing this sort of thing by designing your game code in a certain way?

like image 728
Tom Gullen Avatar asked Jul 02 '10 19:07

Tom Gullen


People also ask

Can hacker change JavaScript?

This kind of attack can be used to exploit possible security flaws on the client-side. The attacker can change the data, hijack the session and make arbitrary JavaScript changes on the page, therefore compromising the security of the original code.

Is there such a thing as unhackable code?

Security Through Obscurity The bottom line here is that there's no such thing as 'unhackable' code. No matter how hard a programmer tries, there's always going to be a vulnerability somewhere.

Why do hackers cheat in games?

Perhaps the most obvious motivation for players to cheat is to attain ranks and status conferred by winning the game. These players will use aimbots, wallhacks, and other tools because they just want the glory of being a winner.

Can computer scientists hack?

Hacking for Computer Science Professionals As a result, "white-hat hacking" has become very prevalent. These are trained computer science professionals who want to aid businesses with improving their security by conducting planned hacks to find points of weakness in their system.


2 Answers

What is stopping someone from copying the game onto their computer, and injecting functions and modules to cheat?

Nothing.

Is there any fundamental way to protect people from doing this sort of thing by designing your game code in a certain way?

Nope.

like image 58
JSBձոգչ Avatar answered Sep 30 '22 13:09

JSBձոգչ


This is why most JavaScript games rely heavily on a server state, to prevent cheats.

like image 40
Luca Matteis Avatar answered Sep 30 '22 13:09

Luca Matteis