How to encrypt user activity information in the browser so it can't be spoofed?

Issue

My users are performing some actions on my website like clicking buttons.
I need to award prizes if a certain sequence of buttons has been clicked.
For every action I store the action information.

When they are done the activity information is sent to the server.
How can I ensure they didn’t just send me that information manually, but actually performed all required actions on the page, e.g. didn’t spoof it?

Solution

Since the browser needs to understand the code, any determined human can do it too.

However you can compress your code using for instance Google Closure compiler. That will discourage most cheaters.

But if you really do want to keep things secret, only the server can guarantee you that.

Answered By – Mic

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published