Score:1

How to Ensure Security in a Gaming Peer to Peer Network

ve flag

I've been recently thinking about building a c++ poker game that would let players to play over sockets in a peer to peer network. However I do not know how security would be ensured. I was thinking that whenever a particular player has a turn, they alter the game state and then they broadcast this game state to the network (the other players in this game). However if the game state contains things like each players cards and the remaining cards in the deck for when a new card is revealed, how can it be ensured that particular players in the network cannot access this information and alter their play style in accordance with that knowledge.

According to this link it may not even be possible to ensure security for gaming in peer to peer network infrastructures and there's always going to be a risk of hacking?: https://cyrextech.net/security-explained-fear-the-peer-to-peer/

I know in blockchains, they ensure the validity of transactions with public/private key signatures, however this doesn't necessarily ensure security/confidentiality, just validity since it doesn't matter that the transactions are necessarily private.

Is there a way to algorithmically ensure that players cannot alter the game state to their will or is it just not possible to do this in p2p structure.

Score:1
my flag

Is there a way to algorithmically ensure that players cannot alter the game state to their will or is it just not possible to do this in p2p structure.

Actually, this is a well studied problem within cryptography; it is known as Mental Poker. The question was "is there a way that a set of parties could play poker just by passing messages without a trusted third party", and the answer is "yes" (however it is rather nontrivial). And, while might sound like that is a rather obscure problem, it turned out that this research was the starting point for Secure Multiparty Computation (which is not at all obscure).

To start with, you might want to look at the Wikipedia article on Mental Poker; it is certainly not sufficient for you to implement it, but it would give you the basics (and has pointers to papers that go into more depth). Now, it may very well be that implementing this is more complex than you care to do at this moment, but this shows that it is possible.

On the other hand, there is one possible cheat that cryptography may not be able to address; a set of players may cooperate (show each other their cards by exchanging messages privately), and collude against another player. In the most extreme case, if there are 10 players (who get 5 cards each), then the 9 colluding players will be able to deduce that the last player's hand will be 5 cards out of a specific set of 7; that is, one of 21 specific hands. I would expect that would give them a significant advantage. A similar (if weaker) advantage would likely occur in less extreme scenarios.

JAAAY avatar
us flag
Nice answer! What about active adversaries? Is there a general theoretical upper bound on percentage of the corrupted parties and security that can be achieved that has been proved for such type of cryptographic protocols, that is not limited to playing poker e.g. the state machine of poker?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.