I am working on an application where a user has to complete a puzzle and check within a given time limit.
This is an HTML5 based game, I can't keep the solution on the client side. but I also want to avoid the latency that will be caused when we check for the correctness of the player's attempt.
Is there a way I can check the correctness of the solution on the client side safely ?
One implementation I was considering was to take the hash of the solution and compare it with hash of user's solution at the client side and once he finally submits it, recheck it on the server side.
Any potential flaws here or are their cleaner ways to accomplish the same ?