Distributed dice game
Virtual 6-sided dice over an insecure network
Technologies: Go
Alice and Bob wants to throw a virtual 6-sided dice over an insecure network. However, they do not trust each other and an adversary with access to the network must not be able to see that they are playing dice. This project simulates the game with a protocol to ensure confidentiality, authenticity, and integrity.
Protocol Explanation
- The client and the server each create a certificate.
- Each of the certificates are signed by a certificate authority (CA).
- Alice rolls a random 6-sided dice.
- Alice creates a commitment with her dice roll with the use of the hashed dice roll (with addition of additional bits) and a nonce.
- Alice connects to Bob via TLS and the initial handshake is performed, which includes certificate verification.
- Alice sends the commitment to Bob over the now encrypted TLS connection.
- Bob rolls a random 6-sided dice.
- Bob sends his dice roll to Alice over the encrypted TLS connection.
- Alice sends her dice roll and nonce to Bob over the encrypted TLS connection.
- Bob verifies Alice’s dice roll by verifying the commitment.
- Given that Bob can verify the commitment, Alice and Bob can compute their common dice roll.