Custom password encryption/decryption against cheats
Posted: Sun Oct 20, 2013 7:24 pm
Now, I'm in final stage of editing details of my game and soon going official with it. So I wanted to hear your ideas on this security 'trick' I am using.
The game is multiplayer and made in Flash (actionscript 3) as UI, with Php communicating with the database.
Since the Flash is not secure enough and since I wanted to stop anyone editing URL for sending false info to Php, I've decided to go with a custom password encryption. I've made a 'system' that works like this:
1. Player logs in and php generates user's "actionpass" (a password that allows him actions ingame): it picks 20 numbers and letters (0 to 9 for numbers, A-Z for letters) ordered by a custom-made code that sets numbers/letters in positions in the string.
2. The actionpass is saved in database for that player.
3. The php then sends the regular data back to Flash UI, along with actionpass.
4. Flash UI receives the actionpass and 'decrypts' it into new 20-characters string, based on the 'reverse' version of a custom-made code from initial Php file. In other words, the 20-chars actionpass sent from Php will be decrypted to only ONE 20-chars version (no random versions).
5. When player sends new request to Php via Flash UI, the Flash sends this decrypted version of actionpass and Php checks it against the stored actionpass in the database, by decrypting it to initial 20-chars version. Only if it's the right actionpass, the Php proceeds with queries, updates etc. If it's not the right actionpass, it warns the player.
6. Whatever happens, Php changes the actionpass again and sends the new 20-chars string to Flash, etc.
What actually commences is Flash/Php exchanging and comparing actionpasses. If a player checks the POST variables, he'll see that Php sends one version of 20-chars and Flash sends different version, and it happens each time. If he notes the actionpass retreived from Php, he cannot use it in URL POST edits, since Php will now expect encrypted actionpass from Flash - and player can know it ONLY when it's already sent from Flash to Php. If he tries to use THAT actionpass (from Flash to Php) he'll find out again that the actionpass on Php side has already been changed so his random actionpass won't work.
In short, player must figure out the code that generates, encrypts and decrypts this actionpass, and both on Flash and on Php side. If actionscript in Flash is secured enough (never 100% I know!) he cannot hope to crack the code since each time he CHANGES it, I log the attempt; and he must do some tests to check his code-decyphering skills.
Now, do you guys think this is useful security measure in mmo game?
The game is multiplayer and made in Flash (actionscript 3) as UI, with Php communicating with the database.
Since the Flash is not secure enough and since I wanted to stop anyone editing URL for sending false info to Php, I've decided to go with a custom password encryption. I've made a 'system' that works like this:
1. Player logs in and php generates user's "actionpass" (a password that allows him actions ingame): it picks 20 numbers and letters (0 to 9 for numbers, A-Z for letters) ordered by a custom-made code that sets numbers/letters in positions in the string.
2. The actionpass is saved in database for that player.
3. The php then sends the regular data back to Flash UI, along with actionpass.
4. Flash UI receives the actionpass and 'decrypts' it into new 20-characters string, based on the 'reverse' version of a custom-made code from initial Php file. In other words, the 20-chars actionpass sent from Php will be decrypted to only ONE 20-chars version (no random versions).
5. When player sends new request to Php via Flash UI, the Flash sends this decrypted version of actionpass and Php checks it against the stored actionpass in the database, by decrypting it to initial 20-chars version. Only if it's the right actionpass, the Php proceeds with queries, updates etc. If it's not the right actionpass, it warns the player.
6. Whatever happens, Php changes the actionpass again and sends the new 20-chars string to Flash, etc.
What actually commences is Flash/Php exchanging and comparing actionpasses. If a player checks the POST variables, he'll see that Php sends one version of 20-chars and Flash sends different version, and it happens each time. If he notes the actionpass retreived from Php, he cannot use it in URL POST edits, since Php will now expect encrypted actionpass from Flash - and player can know it ONLY when it's already sent from Flash to Php. If he tries to use THAT actionpass (from Flash to Php) he'll find out again that the actionpass on Php side has already been changed so his random actionpass won't work.
In short, player must figure out the code that generates, encrypts and decrypts this actionpass, and both on Flash and on Php side. If actionscript in Flash is secured enough (never 100% I know!) he cannot hope to crack the code since each time he CHANGES it, I log the attempt; and he must do some tests to check his code-decyphering skills.
Now, do you guys think this is useful security measure in mmo game?