https://github.com/monicanagent/cypherpoker/
This has been around for a couple years but its play money so no one seems to care.
I remember someone on 2p2 saying the big problem with mental poker was players dropping out in multiway pots, so the only good implementations are only heads up. You then have to handle escrow of funds if you want real money poker which requires a 3rd party or maybe a blockchain with some script.
The concept doesn't seem that hard but theres probably subtleties I haven't thought of and statistical crypto attacks and such. Basic idea is you encrypt each card with a single key you keep track of and then pass the encrypted card data along with the keyID to villian. Villian shuffles and then encrypts the cards with his own key.
You now have a shuffled deck and to reveal a card both players need to reveal the private key for that card.
An encrypted card would be something like:
Code:
{
encryptedByPlayer1: k11,
encryptedCard: player1KeyRing[k11]({
encryptedByPlayer2: k34,
encryptedCard: player2KeyRing[k34](Ah)
})
}
then to reveal this cards identity, play1er see's he has to reveal k11, he decrypts and also sends the key to player 2. player 2 decrypts with that key and sees the inner section was encrypted with his k34. He decrypts, revealing the identity and sends k34 to player1 who also can decrypt and reveal the card.
I guess you probably also want nonces in there somewhere. Also I guess there is some asymmetry in player 1 knowing the value before player 2... hmm.. now that I've written all that out I'm much less confident this isn't fundamentally a broken design. If anyone knows details of how to do this, I'd love to hear. This has been on my mind anyway because I've been thinking of trying to make a similar card game using some mental poker type scheme, but the game wouldn't be poker related.