{"id":28430576,"url":"https://github.com/rafael-c-alexandre/project-sec","last_synced_at":"2026-04-29T14:06:53.622Z","repository":{"id":87556423,"uuid":"344496941","full_name":"rafael-c-alexandre/project-sec","owner":"rafael-c-alexandre","description":"Project for Highly Dependable Systems Course","archived":false,"fork":false,"pushed_at":"2022-12-20T21:58:15.000Z","size":4429,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T06:48:28.773Z","etag":null,"topics":["adversarial-attacks","byzantine-fault-tolerance","client-server","grpc","java","reliability"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafael-c-alexandre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-03-04T14:11:03.000Z","updated_at":"2022-12-20T20:08:02.000Z","dependencies_parsed_at":"2023-03-13T21:31:00.894Z","dependency_job_id":null,"html_url":"https://github.com/rafael-c-alexandre/project-sec","commit_stats":{"total_commits":120,"total_committers":4,"mean_commits":30.0,"dds":0.575,"last_synced_commit":"43c2e7856f485fbd324f97afaa09079026693a51"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafael-c-alexandre/project-sec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-c-alexandre%2Fproject-sec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-c-alexandre%2Fproject-sec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-c-alexandre%2Fproject-sec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-c-alexandre%2Fproject-sec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafael-c-alexandre","download_url":"https://codeload.github.com/rafael-c-alexandre/project-sec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-c-alexandre%2Fproject-sec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32428641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["adversarial-attacks","byzantine-fault-tolerance","client-server","grpc","java","reliability"],"created_at":"2025-06-05T14:07:23.103Z","updated_at":"2026-04-29T14:06:53.608Z","avatar_url":"https://github.com/rafael-c-alexandre.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SEC project - Highly Dependable Location Tracker\nSEC course project: final stage  - MEIC-A, Group 8:\n- Afonso Paredes, ist189401\n- Rafael Poças, ist189527\n- Rafael Alexandre, ist189528\n\n## Setup\n\n#### Requirements\n\nThe requirements needed to run the program are:\n- Java 15\n- Maven\n- MySQL \n\n\n## Usage\n\nIn order to run the program, at least 3 terminal windows must be open:\n- 1+ server(s)\n- 1+ client(s)\n- 1 Healthcare Authority (HA)\n\n#### 0. Installing and compiling project \n\n1. Have all the previous required tools/software installed and ready for usage.\n\n2. Have MySQL server started. \n\n3. Open `\u003croot-project-directory\u003e/src/main/assets/scripts` and run script **init.sh** to install and compile the whole project.\n\n#### 1. Server initialization\n\nOn `\u003croot-project-directory\u003e`, run \n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e \u003cnByzantineUsers\u003e \u003ckeyStorePassword\u003e \u003cbyzantineMode\u003e\" \n```\n\n- **dbUser**: created user for using the MySQL database\n- **dbPass**: password for created user in MySQL database\n- **nByzantineUsers**: number of byzantine users in the whole system\n- **keyStorePassword**: the private key store password\n- **byzantineMode**: The mode that specifies which attack should be performed by the byzatine server\n    - Mode `1`: Byzantine server sends wrong report when user request a location report \n    - Mode `2`: Byzantine server sends 0 reports when user request a location report \n    - Mode `3`: Byzantine server responds with fake users at location to the HA\n    - Mode `4`: Byzantine server responds with no users at location to the HA\n    - Mode `5`: Byzantine server always responds that the report is proven when a proof is submited\n    - Mode `6`: Byzantine server sends 0 proofs to request my proofs by client\n    - Mode `7`: Byzantine server sends fake proofs to request my proofs by client\n    - Default: Normal server behaviour\n\nFor this program, it is required to enter the passwords of the key stores that store all the keys/certificates used during communication.\nFor every one of those stores, the password is set by default to `123456`. However, we **strongly recommend** that the user changes that password to a stronger one, which can be done by issuing the command `keytool -storepasswd -keystore \u003croot-project-directory\u003e/src/assets/keyStores/\u003ckey-store-name\u003e`.\n\n#### 2. Client initialization\n\nOn `\u003croot-project-directory\u003e`, run \n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"\u003cusername\u003e \u003cgridFilePath\u003e \u003ckeyStorePassword\u003e \u003cnByzantineUsers\u003e \u003cnByzantineServers\u003e \u003cbyzantineMode\u003e [\u003cscriptFilePath\u003e]\" \n```\n\n- **username**: username for the client\n- **gridFilePath**: path to the file containing the locations' grid\n- **keyStorePassword**: the private key store password\n- **scriptFilePath**: path to the file containing a script of user's commands \n- **nByzantineUsers**: number of byzantine users in the whole systemcommands \n- **nByzantineServers**: number of byzantine servers in the whole system\n- **byzantineMode**: The mode that specifies which attack should be performed by the byzatine user\n    - Mode `1`: generates wrong location in report when requesting to server\n    - Mode `2`: wrong epoch when creating proofs to other prover\n    - Mode `3`: sends proof request to every witness available, at any range\n    - Mode `4`: gives proof to every prover who requests, use prover location as own location in the proof to make sure the server accepts it\n    - Mode `5`: witness captures other user's proof and replays it\n    - Mode `0`: Regular user\n\n\nFor this program, it is required to enter the passwords of the key stores that store all the keys/certificates used during communication.\nFor every one of those stores, the password is set by default to `123456`. However, we **strongly recommend** that the user changes that password to a stronger one, which can be done by issuing the command `keytool -storepasswd -keystore \u003croot-project-directory\u003e/src/assets/keyStores/\u003ckey-store-name\u003e`.\n\n#### 3. Healthcare Authority initialization\n\nOn `\u003croot-project-directory\u003e`, run \n\n```bash\nmvn exec:java -Dexec.mainClass=\"HA.HAClient\" -Dexec.args=\"\u003ckeyStorePassword\u003e \u003cnumberOfByzantineUsers\u003e \u003cnumberOfByzantineServers\u003e [\u003cscriptFilePath\u003e]\"\n```\n- **keyStorePassword**: the private key store password\n- **nByzantineUsers**: number of byzantine users in the whole systemcommands \n- **nByzantineServers**: number of byzantine servers in the whole system\n- **scriptFilePath**: path to the file containing a script of user's commands \n\nFor this program, it is required to enter the passwords of the key stores that store all the keys/certificates used during communication.\nFor every one of those stores, the password is set by default to `123456`. However, we **strongly recommend** that the user changes that password to a stronger one, which can be done by issuing the command `keytool -storepasswd -keystore \u003croot-project-directory\u003e/src/assets/keyStores/\u003ckey-store-name\u003e`.\n\n\n## Demos and tests\n\nBefore every test case, run \n```bash \nmysql -p \u003c schema.sql\n``` \non `\u003croot-project-directory\u003e/src/main/assets/sql_scripts\u003e` to create a clean database.\n\n### Case 1 - stage 1. Correct Behaviour\n\nFor this test case, start 1 server with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**. After the users stabilize by proving each others' locations, start an HA client using the command file **correct_behaviour_ha.txt**.\n\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 0 123456 0\" \n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid1.txt 123456 0 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 3:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid1.txt 123456 0 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\nOn terminal 4:\n\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user3 src/main/assets/grid_examples/grid1.txt 123456 0 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 5:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"HA.HAClient\" -Dexec.args=\"123456 src/main/assets/command_files/correct_behaviour_ha.txt\"\n```\n\n\n\nThis test reflects the correct behaviour of the program. Users prove their location correctly by issuing broadcast proof request to other witnesses and submitting them to the server. Plus, clients request their locations for a specific epoch and the HA request all the clients in some position at a given epoch.\n\n\n### Case 2 - stage 1. Byzantine user tries to generate a valid report using a fake location\n\nFor this test case, start 1 server, 1 byzantine user with username byzantine_user1 in mode 1, 3 regular users with usernames user1 and user2 , all of them using the grid file **grid2.txt**. \n\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 1 123456 0\" \n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid2.txt 123456 1 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 3:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid2.txt 123456 1 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"byzantine_user1 rc/main/assets/grid_examples/grid2.txt 123456 1 0 1 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\nA byzantine prover sends a legit proof request to the witnesses but sends an incorrect location report to the server, hoping the server accepts those proofs as valid for the aforementioned report. This will make the server reject the proofs based on location disparity.\n\n\n\n### Case 3 - stage 1. Byzantine user generating and sending a wrong proof to a correct user (altered epoch)\n\nFor this test case, start 1 server, 1 byzantine user with username byzantine_user1 in mode 2, 2 regular users with usernames user1 and user2,  all of them using the grid file **grid3.txt**. \n\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 1 123456 0\" \n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid3.txt 123456 1 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 3:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid3.txt 123456 1 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"byzantine_user1 rc/main/assets/grid_examples/grid3.txt 123456 1 0 2 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\nIn this test case, a byzantine user sends wrong location proofs to correct users that made a request, changing the epoch of the proof. It is expected that the server rejects the invalid proof.\n\n\n\n\n### Case 4 - stage 1. Byzantine users collaborate to fake one byzantine user's location\n\n\nFor this test case, start 1 server, 2 byzantine users with usernames byzantine_user1 in mode 3 and byzantine_user2 in mode 4, 3 regular users with usernames user1 user2 and user3, all of them using the grid file **grid4.txt**. \n\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 2 123456 0\" \n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid4.txt 123456 2 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 3:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid4.txt 123456 2 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 4:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user3 src/main/assets/grid_examples/grid4.txt 123456 2 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 5:\n\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user3 src/main/assets/grid_examples/grid4.txt 123456 2 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"byzantine_user1 rc/main/assets/grid_examples/grid4.txt 123456 2 0 3 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 7:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"byzantine_user2 rc/main/assets/grid_examples/grid4.txt 123456 2 0 4 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\nIn this test, there are 2 byzantine users collaborating. One is trying to prove himself to be in a fake location, the other is colluding with the byzantine prover, sending fake proofs that match the fake proof request of the first one. However, because they will not be able to send f (in this case 2) valid proofs to the server, the report will not be accepted.\n\n\n\n### Case 5 - stage 1. Byzantine user tries to replay a correct user's proof\n\n\nFor this test case, start 1 server, 1 byzantine user with username byzantine_user1 in mode 5, 2 regular users with usernames user1 and user2, all of them using the grid file **grid5.txt**. \n\n\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 2 123456 0\" \n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid5.txt 123456 2 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 3:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid5.txt 123456 2 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"byzantine_user1 rc/main/assets/grid_examples/grid4.txt 123456 2 0 5 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 5:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"byzantine_user2 rc/main/assets/grid_examples/grid4.txt 123456 2 0 5 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\n\n\nIn this test, the byzantine user captures a valid proof from a correct witness to a correct prover and replays it, also sending it to the prover. Because the proof comes, supposedly, from a user that has already submitted a proof for that report, the server will reject it.\n\n\n#### Case 6 - stage 1. Server crashes and recovers its states after rebooting\n\nFor this test case, start 1 server with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid6.txt** and using the command file **correct_behaviour.txt**. After the users stabilize by proving each others' locations, start an HA client using the command file **correct_behaviour_ha.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 2 123456 0\" \n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid6.txt 123456 0 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 3:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid6.txt 123456 0 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 4:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user3 src/main/assets/grid_examples/grid6.txt 123456 0 0 0 src/main/assets/command_files/correct_behaviour.txt\" \n```\n\nOn terminal 5:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"HA.HAClient\" -Dexec.args=\"123456 correct_behaviour_ha.txt\"\n```\n\n\nAfter submitting all the reports, **crash the server**.\nThen reboot it again:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"\u003cdbUser\u003e \u003cdbPass\u003e 0 123456 0\" \n```\n\n\nWhen the central server goes down, its in-memmory data is lost forever. However, all data is also stored in an external database, allowing the server to reboot and recover its previous up-to-date state.\n\n#### Correct Behaviour - stage 2. \n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 1 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 1\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0 src/main/assets/command_files/stage2_behaviour.txt\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0 src/main/assets/command_files/stage2_behaviour.txt\"\n```\n\nOn terminal 8:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"123456 1 1 src/main/assets/command_files/stage2_behaviour_ha.txt\"\n```\n\n#### Case 1 - stage 2. Byzantine server sends wrong report when user request a location report\n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 1 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 1\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nNote that when the users request a location proof there will be displayed an error message stating the received report was invalid, that was the report from the byzantine correclty identified as faked. The user should also receive good reports from the correct servers and display the result.\n\n#### Case 2 - stage 2. Byzantine server sends 0 reports when user request a location report \n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 2 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 2\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\n\nThe user should receive good reports from the correct servers and display the result even though one byzantine user returned an error.\n\n#### Case 3 - stage 2. Byzantine server responds with fake users at location to the HA\n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 3 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 3\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nThe HA should return the correct answer from the quorum of responses from the correct servers even though one response is fake.\n\n#### Case 4 - stage 2. Byzantine server responds with no users at location to the HA\n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 4 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 4\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nThe HA should return the correct answer from the quorum of responses from the correct servers even though an error will be returned from the byzantine server\n\n#### Case 5 - stage 2. Byzantine server always responds that the report is proven when a proof is submited\n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 5 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**. After the users stabilize by proving each others' locations, start an HA client using the command file **correct_behaviour_ha.txt**.\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 5\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nThis should return the correct proofs because the client merges all the correct proofs received and the client waits for a majority of servers, which means at least one response was from a correct server.\n\n#### Case 6 - stage 2. Byzantine server sends 0 proofs to request my proofs by client\n\nFor this test case, start 3 correct servers and 1 byzantine server in mode 6 with 0 byzantine users. 3 regular users with usernames, user1 user2 and user3 using the grid file **grid1.txt** and using the command file **correct_behaviour.txt**. After the users stabilize by proving each others' locations, start an HA client using the command file **correct_behaviour_ha.txt**.\n\n\nOn terminal 1:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server 6\"\n```\n\nOn terminal 2:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server2 0\"\n```\n\nOn terminal 3:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server3 0\"\n```\n\nOn terminal 4:\n```bash\nmvn exec:java -Dexec.mainClass=\"Server.Server\" -Dexec.args=\"root 123 1 123456 server4 0\"\n```\n\nOn terminal 6:\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user1 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nOn terminal 7:\n\n```bash\nmvn exec:java -Dexec.mainClass=\"Client.Client\" -Dexec.args=\"user2 src/main/assets/grid_examples/grid7-stage2.txt 123456 1 1 0\"\n```\n\nThis should return the correct proofs because the client merges all the correct proofs received and the client waits for a majority of servers, which means at least one response was from a correct server.\n \n\n\n#### Note\nIf command `konsole` is installed, it is also possible to run the test scripts `test\u003ccase_number\u003e-stage\u003cx\u003e.sh` to perform the test. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafael-c-alexandre%2Fproject-sec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafael-c-alexandre%2Fproject-sec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafael-c-alexandre%2Fproject-sec/lists"}