[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Alice and Bob want to play a card game over the internet. They
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 27
Thread images: 1
File: Karty_do_gry_._Playing_card.jpg (756 KB, 1715x1188) Image search: [Google]
Karty_do_gry_._Playing_card.jpg
756 KB, 1715x1188
Alice and Bob want to play a card game over the internet. They don't want to use a third party because Eve may be able to compromise the third party and read or rearrange the deck as they play.

Because neither Alice nor Bob will be able to resist temptation, they need a way for both of their computers to agree on a deck order without knowing what that deck order is. While they play, they need a way to "draw" a card and update both computers to a new deck while only showing the player who "drew" the card what the card is.

Is there a way for this to happen, or is it impossible?
>>
no, who plays the Croupier?
>>
http://lmgtfy.com/?q=bars+near+me
>>
>>53543083
>over the internet
>>
>>53543005
The game just have to run in a closed runtime and then interface with both players
>>
>>53543005
Yes it's possible.

http://www.cs.du.edu/~chrisg/publications/pittman-netgames11.pdf
https://crypto.stanford.edu/~pgolle/papers/poker.pdf
>>
>>53543127
MySQL?
>>
>>53543142
>The authors show that its impossible to deal from a shared deck of cards without one player knowing what card another player received.
>>
>>53543142
Can you explain at high level
>>
I choose a number and send you its hash. You send me a number. I send you my number which you verify didn't change. We cat our numbers together and use it to seed our deterministic RNG. Solvt
>>
Do this for every card and over a secure channel.
>>
>>53543248
>determine next card
>both players now know what card was drawn
>>
>>53543248
But then both sides know the output of that RNG. One requirement is that only the side that draws the card knows the card.

I could see maybe a variation of this working, but with the caveat that cheating could only be detected after the game is over by both sides sharing the data on any cards that werent visible to the other, and running the whole game through a verification process
>>
Sorry. I only skimmed ops post before I tried to solve it.
>>
>>53543339
Eg just from top of my head.

Alices turn to draw. Alice generates a value and sends the hash to bob. Bob generates a value and sends to alice. Both values are cat-ed on alices side, and feed the deterministic generator to give alice a random number (card).

When the game is over, alice sends bob all of her initial values which he can match against the hashes he received during the game, and run the same rng to verify that the correct cards were drawn as those that appeared in the game.
>>
>>53543243
>>53543246
You can't deal the entire deck as one object but you can deal hands. You have to model the deck differently.

https://www.cs.purdue.edu/homes/ninghui/courses/Fall05/lectures/355_Fall05_lect25.pdf
>>
>>53543403
How can Bob remove the card from the deck when he will draw?
>>
>>53543142
Thank for the PDFs anon.
>>
Before play: each player randomly generates 52 keys, one for each card, and hashes each one while keeping them in order. Each player encrypts each card with its key. Both players now have a deck of encrypted cards from Ace of Spades to King of Hearts.

To shuffle: each player randomly selects a large number, then shuffles their deck (and the hashes of the keys) that number of times, using the same shuffling function as the other player. For example, Alice performs shuffle(deck) 492447 times, and Bob performs shuffle(deck) 92742 times. Each player now has a shuffled deck, but they're not in sync. They now send each other their decks (but keep a backup copy of their decks with their keys). Alice shuffles her copy of Bob's deck (which has been shuffled 92742 times) the same number of times she shuffled her own deck (492447 times, for a total of 585189 times), and Bob does the same to his copy of Alice's deck. Both decks are now in the same order, but neither player can tell what that other is.

To deal: When Alice draws a card, she moves the top card from her copy of Bob's deck to her hand and asks Bob to send the top card of her deck back to her. Bob sends the top card of his copy of Alice's deck over and puts a copy in Alice's hand on his machine (along with the key). Bob doesn't know what Alice's new card is, but Alice can decrypt and read what card she just drew. When Bob draws, the roles are reversed. Both players keep track of who drew which card in order.

To play: When Alice wants to play a card, she sends over her encrypted card and the key to decrypt the card. Bob can verify that Alice has the card she claims to be playing (it's in his own copy of her hand), and that the key corresponds to the card she sent (its hash would match the one attached to the card). Bob then decrypts the card and is up to date with what Alice played.

Does this work/even make sense?
>>
>>53545442
Tl;dr it's complicated as fuck.

I really wish somebody would implement this. I was looking for a way to play rummy online but found nothing.
>>
>>53545541
It's not as complicated as I thought it'd be actually
>>
>>53545442
This really sounds good and at first glance, totally feasible. I am high right now but dont let that detract.

Is a possible attack that alice can also track which cards have appeared and which order they came out of the deck? Then she can just iterate through bobs possible how-many-times-to-shuffle values and find all the possible decks which match the current cards-observed-so-far. She'd be able to give herself really good chance-to-appear on the most likely next cards, and those stats would improve in accuracy the more cards are played.
>>
>>53546866
I'm not a cryptographer, so I might be missing something.

Card counting is already a thing, and I'm not sure how Alice could determine how many times Bob would have had to shuffle to get that card in that spot. However, even if Alice knows the starting positions of a whole suit of cards, she'd have 39! possible permutations.

It would probably come down to how strong the shuffle() algorithm is and how large the numbers picked are. If Alice and Bob are patient enough to wait for shuffle() to iterate near 52! times, then this sort if attack is unfeasible with a strong shuffle() function.
>>
>>53545442
That is pretty good, I'm gonna sit down and take a closer look when I get the chance but it seems like an elegant solution that should work fine to me.
>>
Alice and Bob each pick encryption/decryption keys for commutative encryption functions. Commutative keys have the property that you can apply decryption keys in any order.

Alice shuffles the entire deck, encrypts each card individually and transmits each encrypted card one by one to Bob. Bob receives 52 cards each encrypted with the same encryption key, but since he doesn't have the decryption key he can't tell what the order is.

Bob takes the shuffled deck and shuffles it again. He encrypts the first card. Then he concatenates the Alice-encrypted second card with the doubly-encrypted first card and encrypts the whole thing together as one message. Then he takes this encrypted message, appends the Alice-encrypted third card and encrypts the whole bigger message. Repeat until no cards remain. Bob should have one huge message. He transmits this message to Alice.

Both now have the same deck and neither one knows the order. To draw a card for Alice, Bob decrypts the deck, and strips off the appended Alice-encrypted card. What remains is a Bob-encrypted deck. He transmits the new deck and the Alice-encrypted card to Alice. Alice can decrypt her card but not the whole deck. To draw a card for Bob, Bob decrypts the deck and strips off the appended Alice-encrypted card. He transmits the new deck. To figure out what card he just drew, he encrypts the Alice-encrypted card with his key and sends it to Alice. Alice decrypts the doubly-encrypted card and transmits it back to Bob who can finally decrypt the card and see what it is.
>>
op the point of your homework is to teach you how to actually learn, act, and react to real life situations

if you don't learn it and let other people do it you'll just be a monkey who can't do its job and is fired in 2 weeks

shame on you /g/ for doing it for them
>>
>>53547845
What school do you go to that has problems such as this?
Thread replies: 27
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.