{"id":19198383,"url":"https://github.com/simonskodt/secu1-virtual-dice","last_synced_at":"2026-06-19T13:32:07.681Z","repository":{"id":61902904,"uuid":"548384646","full_name":"simonskodt/secu1-virtual-dice","owner":"simonskodt","description":"The second mandatory hand-in in Security 1. Implementing a protocol that allows Alice and Bob to roll a virtual dice over an insecure network even though they do not trust each other.","archived":false,"fork":false,"pushed_at":"2022-10-25T12:28:13.000Z","size":649,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T05:13:44.627Z","etag":null,"topics":["commitment-schemes","golang","multiparty-computation","sha256-hash","tls-certificate"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonskodt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-09T13:10:52.000Z","updated_at":"2023-10-20T13:03:05.000Z","dependencies_parsed_at":"2023-01-20T11:00:26.901Z","dependency_job_id":null,"html_url":"https://github.com/simonskodt/secu1-virtual-dice","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/simonskodt/secu1-virtual-dice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonskodt%2Fsecu1-virtual-dice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonskodt%2Fsecu1-virtual-dice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonskodt%2Fsecu1-virtual-dice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonskodt%2Fsecu1-virtual-dice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonskodt","download_url":"https://codeload.github.com/simonskodt/secu1-virtual-dice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonskodt%2Fsecu1-virtual-dice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34534274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commitment-schemes","golang","multiparty-computation","sha256-hash","tls-certificate"],"created_at":"2024-11-09T12:21:41.494Z","updated_at":"2026-06-19T13:32:07.656Z","avatar_url":"https://github.com/simonskodt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mandatory Hand-in 2: Virtual dice\n\n**The second mandatory hand-in in Security 1.**\n\n## Purpose\n\nIn a peer-to-peer network, the assignment is to implement a coin-flipping protocol that allows Alice and Bob to roll a virtual dice over an insecure network (assumption: they do not trust each other). The commitment scheme is hash-based, and this ensures that the chosen statement is hidden from every node in the network, but at a later point, this statement can be revealed.\n\n## How to run\n\nOpen two terminals that represent Alice and Bob respectively. The format of the command-line input is\n\n```cmd\ngo run . \u003cflag init\u003e :\u003cport\u003e \u003cport of other nodes\u003e \u003cname\u003e\n```\n\nHere, the flag should only be set on one of the nodes, preferably Alice. This flag expects a boolean value afterwards which here should be `true`.  If none are given, then the default value is `false`.\n\n**Expected command-line input**\n\n```cmd\nAlice’s terminal: go run . -init true :9000 9001 Alice\nBob’s terminal:   go run . :9001 9000 Bob\n```\n\nThis exact input is given in the script [run_split.ps1](./src/run_split.ps1) which creates the two PowerShell terminal instances next to each other (shown below).\n\n![command line excution](./img_run.png)\n\n## Errors\n\nSince we are dealing with GRPC, Googles RPC framework, that connects services, sometimes errors occur.\n\n### RPC error\n\n**Error on server :: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp [::1]:9001:**\n\nThis happens when the Bob server takes too much time loading up. Close terminal, and try again.\n\n### Usage of more than one socket address\n\n**Server failed to listen af port :9001 :: listen tcp :9001: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.**\n\nIf a previous terminal instance is not closed, then the error message of multiple socker address usage is shown. Close both terminals, and try again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonskodt%2Fsecu1-virtual-dice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonskodt%2Fsecu1-virtual-dice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonskodt%2Fsecu1-virtual-dice/lists"}