packet encryption

Started by
4 comments, last by Michalson 18 years, 10 months ago
I need to send absolute coordinates from the server for a given player his client machine. My game only shows a users relative coordinates (the absolute coordinates are hidden from the player). I know sending the info plan text makes it very vulnerable to packet sniffing. If i encrypt the data coming from the server how much protection will i get? I understand that better encryption techniques will increase CPU load and add overhead. Can i sufficiently obfuscate the data to prevent players from decrypting the coordinates, or is it just a matter of time before they do? Similarly, those absolute coordinates will be held in RAM on the local machine. How vulnerable is that data? Regards, PD
www.ChippedDagger.com"They that can give up essential liberty to obtain temporary safety deserve neither." -- Benjamin Franklin"If opportunity doesn't knock, build a door." -- Milton Berle
Advertisement
I'm assuming you're trying to avoid players from figuring out the comunication protocol and just sending packets with whatever position they wish to be without actually having to travel there.

To do that you don't need to encrypt your data, on the server side limit the maximum distance a user can send to the server, considering the last know coordenates he was in, and the amount of time that has passed since the last coordenates update. So if a user sends the server a new location that's 6 distance units appart from the current location, and that player moves at a speed of 2 units per second, and as only been 2 seconds since his last update(you should limit this variable though, so that a player doesn't just wait a long time and then send you a packet with a huge distance), you know you should drop that packet, because the maximum distance travelled should be 4 units.
Quote:Original post by xor
I'm assuming you're trying to avoid players from figuring out the comunication protocol and just sending packets with whatever position they wish to be without actually having to travel there.

To do that you don't need to encrypt your data, on the server side limit the maximum distance a user can send to the server, considering the last know coordenates he was in, and the amount of time that has passed since the last coordenates update. So if a user sends the server a new location that's 6 distance units appart from the current location, and that player moves at a speed of 2 units per second, and as only been 2 seconds since his last update(you should limit this variable though, so that a player doesn't just wait a long time and then send you a packet with a huge distance), you know you should drop that packet, because the maximum distance travelled should be 4 units.


No that's not what i'm trying to achieve. Data sent from the client to the server doesn't involve absolute coordinates, or even relative ones. It merely sends a request to the server saying "move forward", "move backward", "strafe left", and so on.

My problem is that i have multiple groups. These groups are at odds with one other. Much like the horde and alliance in World of Warcraft. Players cannot communicate with players of opposing factions. In addition players can only have a single character on the server. This does not, however, keep people from using multiple accounts. Player A could create an account and create a character to infiltrate an opposing faction. If i allow absolute coordinates, then the spy could simply relay those coordinates to his faction. While this cannot be done ingame, it can be done by any number of out-of-game mediums: teamspeak anyone?

I don't mind people spying, but i don't want espionage to be trivial and without risk. Even if i only give relative coordinates players could still get a location by two players (of opposing factions) meeting at an already known location, then player A leading player B to the desired locale. This i don't mind because both players must incur risk. Such as a player and a traitor showing up together at the military staging area. Other players will notice this and both will be dispatched accordingly. Not to mention the spy will be out in the open.

If players can get their absolute coordinates from either decrypting the packets and/or obtaining it from ram, then it devolves back to simply hacking the client machine to obtain the data. Player A stands at the military staging area, uses his l33t cheat proggy to get his absolute coordinates, then relays those to player B who is also running the cheat and can converge on player A's location.

This is the situation i am trying to avoid. Sorry i guess i should have given a more detailed synopsis of my problem to begin with.

PD
www.ChippedDagger.com"They that can give up essential liberty to obtain temporary safety deserve neither." -- Benjamin Franklin"If opportunity doesn't knock, build a door." -- Milton Berle
Oh sorry.

I'm not sure what to tell you, your problem in a universe such as WOW wouldn't be much of a problem because even if people locate the oposing clans, well, they can run away, they can have enough numbers and stay and fight, they could even realize they were being stalked and kill the spy, what i mean is, there is not much of an importance associanted with a location, or with the knowledge of a location of a certain clan or faction.

In your game i don't know, so i'm going to assume there is in fact a need for each clan or faction to keep certain locations secret, otherwise i'de just advise you to forget about it.

So if that's the case, do like you said, use relative coordenates, and don't keep absolute coordenates in the client. If you don't keep absolute coordenates in the client, ppl can't access then in the ram, if you don't send them from the server to the client they can't sniff them. Still if you need to send them for some reason, then there is no 100% way of making sure someone won't get access to them, so just use a XOR encryption method, it's enough to deter most, and it's performance friendly, and stop losing sleep over it, because there is no sure way of doing it.(the first to mention quantum encryption gets it[grin])
You cannot, generally, prevent a user from decoding all the data that you send to him. Your client software can decode it; thus the user can reverse-engineer the client sofware and do the same thing.

If you charge for accounts, at least you'll have the pleasure of knowing that you'll get twice the money from the people using the "spy cheat".

If you want to scramble the data so it's harder to read for a casual observer, I recommend the TEA or X-TEA algorithms, in conjunction with a session key that's negotiated on start-up. The algorithm is fast and secure.
enum Bool { True, False, FileNotFound };
Quote:Original post by pink_daisy
No that's not what i'm trying to achieve. Data sent from the client to the server doesn't involve absolute coordinates, or even relative ones. It merely sends a request to the server saying "move forward", "move backward", "strafe left", and so on.

My problem is that i have multiple groups. These groups are at odds with one other. Much like the horde and alliance in World of Warcraft. Players cannot communicate with players of opposing factions. In addition players can only have a single character on the server. This does not, however, keep people from using multiple accounts. Player A could create an account and create a character to infiltrate an opposing faction. If i allow absolute coordinates, then the spy could simply relay those coordinates to his faction. While this cannot be done ingame, it can be done by any number of out-of-game mediums: teamspeak anyone?

I don't mind people spying, but i don't want espionage to be trivial and without risk. Even if i only give relative coordinates players could still get a location by two players (of opposing factions) meeting at an already known location, then player A leading player B to the desired locale. This i don't mind because both players must incur risk. Such as a player and a traitor showing up together at the military staging area. Other players will notice this and both will be dispatched accordingly. Not to mention the spy will be out in the open.

If players can get their absolute coordinates from either decrypting the packets and/or obtaining it from ram, then it devolves back to simply hacking the client machine to obtain the data. Player A stands at the military staging area, uses his l33t cheat proggy to get his absolute coordinates, then relays those to player B who is also running the cheat and can converge on player A's location.

This is the situation i am trying to avoid. Sorry i guess i should have given a more detailed synopsis of my problem to begin with.

PD


If your game mechanics rely on clans being able to move in secret you'll also need to factor in grieve players - the kind of player who joins a clan, then proceeds to go shouting "here we are" (though if your game requires a credit card you manage to filter out some kiddies).

This topic is closed to new replies.

Advertisement