Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 Multiplayer Game Security Solutions

Now that there are a couple of neat canvas demo's of both classic platform and even 3D fps games in HTML5, the next step might be to try developing a multiplayer HTML5 game. HTML5 socket support makes this relatively straight-forward, but with client-side source being viewable by anyone in the browser, what are some solutions for basic game security features for a HTML5-frontend multiuser game -- such as being able to prevent a faked high-score submit?

like image 624
ina Avatar asked Jun 05 '10 03:06

ina


People also ask

Are HTML5 games safe?

Do HTML5 apps pose any security threats for developers and businesses? The answer unfortunately is yes. Apps built with HTML5 are like any web-based applications. Developers should take proper security measures against cyber attacks to safeguard any stored data and communications.

Can you code a game in HTML5?

Since most game developers want to focus on their actual game and not in creating this whole abstraction layer, it is recommended you use a HTML5 game frameworks. HTML5 game frameworks and libraries that contain building components you can use to create your own games.

How can I play HTML5 offline?

TL;DR: There are only really two techniques you should use to make your game playable offline: Web Storage (local storage) and Appcache. Use local storage to store only information and not to store your games files and assets (especially JavaScript).


1 Answers

The simple answer is: You can't trust the data from client, which means that the high score submit can't come from the client.

Since the code client is available for anyone to inspect, there's no way of trusting the data that the client sends your server. Even if you encrypt the data with a per-user encryption key (which is possible), the user can simply alter your code within the browser and change the values it's sending to the server.

Since your game is multiplayer, this might be possible IF the server generates all the scoring events. If the server generates all the scoring events, the client never sends score data to the server which means that the high score data can't be faked.

You'll still have to deal with cheating, which is even more challenging, but that's another issue...

like image 100
ReinstateMonica Larry Osterman Avatar answered Sep 30 '22 12:09

ReinstateMonica Larry Osterman