There is a method to play cards on internet and be fair and secure. However, I expect a generous tip
, do you agree? If you agree then read on
1. There are N players at the table.
2. Each player generates his own encryption and decryption keys for commutative chipper. Both are secret. (More about such chippers later.)
3. A salt is selected and published.
4. Player 1 creates a deck. Each card consists of plain text: card,siut,salt
5. Each player, including player 1, encrypts each card with his own encryption key, shuffle the whole deck, and then passes the deck to a next player.
6. When the deck has been encrypted and shuffled by everyone, anyone can be a dealer. It can be player N, or 1, or random one.
7. When dealer wants to give a card to player K, he first passes this card to Player K+1 for decryption. (Of course if card is for player N then start with player 1.) Each player, starting with K+1, decrypts the card and passes it to next one (player 1 is next after player N). In this way Player K gets the card last. When decrypted by player K, the card will read: card,siut,salt. If message is readable (salt does match) then no tampering has occured.
Since player K is the last to decrypt the card, he can be sure no one else knows what card he was delt! You can play any kind of card game in this way. How cool is that?
Now about commutative chipper as prommised in step 2. This is a chipper where E(key1, E(key2, message)) = E(key2, E(key1, message)). This means that you can decrypt in any order.
You can use a variation of RSA encryption to achieve this. In this variation both encryption and decryption keys are SECRET
. However, the parameters necessary to generate them are public. In particular two prime numbers are disclosed.
So we publicly generate two large prime numbers p and q, then calculate n=p*q and PHI=(p-1)*(q-1).
Next each player in secret picks up his own encryption key e which is relatively prime to PHI. If N is large that is trivial with ony few trials and errors.
Each player, also in secret, calculates decryption key d=e^(-1) mod PHI.
Encryption is calculated as c = m^e mod n (where c stands for cypertext and m for message).
Decryption is calculated as m = c^d mod n.
For the sake of this example m = (card-2) + 13 * siut + 52 * salt
card = (m mod 13) + 2
siut = floor(m/13) mod 4
salt = floor(m/52)
My tip wallet is 1FQkH63k6hkexFMTRzLtJEE6ZAaTBRhjiS
So if one player leaves at any point the hand is stuck? Or is it less strict than that?