Eunice Chia
Eunice Chia

Reputation: 355

Hide html DOM data to end user

http://callmenick.com/_development/memory/ Without inspect element I can know the hidden image by looking at the DOM. Says I want to make competition using this game, how can that be done? How to make the game non-hackable?

Upvotes: 2

Views: 245

Answers (2)

Jacob
Jacob

Reputation: 78850

You cannot truly make it "unhackable" unless you store the contents of the game in another location, like on some server. You can make it more difficult for people to figure out the data (obfuscation), but if your JS can understand the data, and the JS is loaded in the browser, then all the information is there for reverse engineering by someone that is dedicated to the task.

Upvotes: 2

mwilson
mwilson

Reputation: 12900

One option would be to use base64 instead of an image path. This would at least make it much more difficult for someone to see what image is what. Instead of a friendly file path, it'd be a long string of characters.

Another good option would be to look at some of the options mentioned in the article below:

http://www.htmlgoodies.com/beyond/article.php/3875651/Web-Developer-Class-How-to-Hide-your-Source-Code.htm

Upvotes: 0

Related Questions