This post assumes you know what a trap door function is, and also about Gautham B Pai... and his cow and bulls game and the challenges he seems to be facing with javascript....
The challenge is to make the game completely using javascript and only upload the results back to the server. This seems to be one of the ways to "Make the game run completely using javascript"....
First all the numbers 0 to nine are encrypted using a trap door function such as RSA. The numbers have to written in words(filled with blanks to make all the numeric words equal) to prevent easily breaking the code by trial and error. If further higher levels of security are needed the number combinations should be used.
Ok so basically we have an array of encoded numbers in word form.We also have the public key to encrypt the guesses from the user. Based on the output from random number function, a variable set is choosen from the array. The values entered by the user are encrypted using the public key and compared with value stored in the choosen variable set. If both are equal, the results are sent to server...
This method can be effective if the public key seed value is defined by the server at the time the javascript is generated.This ensures the effective and secure game plan...!!!!!!! Since the player cant know the actual value of the number even if he knows the encrypted form of the number this should work..
1 comment:
Interesting way out! Thanks.
Post a Comment