...which you should be able to convert to actionScript as they are broadly similar languages but it may be easier to do the encrypting serverside with PHP (where the function is built-in and very quick) and return the encrypted string to Flash although this does raise security issues I suppose.
I am doing this to make a flash game, and when the game is over, it sends some variables to a PHP script that tracks High Scores. The problem with that is that anyone can type into their browser highscore.php?s=999999999&n=Hacker and cheat the system.
I was thinking I could also pass an MD5-encrypted string which includes the person's score along with a secret word. For example, the MD5 of "10720jenson". That gets sent as highscore.php?s=10720&n=Legit%20Player&k=3cc4c497248830887bd731f967fbe2cf. The PHP script verifies that the score claimed is in accord with the MD5 sum. I think that works because nobody knows how to generate the proper MD5 sum, since they don't know the secret word.
I have a question about Flash strings and the JavaScript code
Code:
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
Does Flash use Unicode or ASCII? In the help files, it claims to use Unicode, but in my experience whenever I paste Unicode text into the ActionScript window, all I get is a bunch of question marks.
That seems like overkill to me. Sending the variables via loadVars() and 'POST' instead of 'GET' means that they can't type a query string like the one you demonstrated - they won't see the values being passed so can't cheat.
Unicode settings are controlled by System.useCodePage which toggles between local and full unicode settings - set to true or false depending on what you want to use.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.