{"id":25198178,"url":"https://github.com/drmick/rust-hashcash-ddos","last_synced_at":"2025-04-04T17:20:46.629Z","repository":{"id":81250531,"uuid":"457776044","full_name":"drmick/rust-hashcash-ddos","owner":"drmick","description":"The application shows how to resist DDOS attacks using proof of work algorithm","archived":false,"fork":false,"pushed_at":"2022-03-18T17:17:45.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T02:41:27.219Z","etag":null,"topics":["ddos","hashcash","rust","tokio-rs"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/drmick.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-10T12:43:15.000Z","updated_at":"2025-02-02T22:02:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"4142cc94-96d7-4193-98eb-9a2c1e69fb31","html_url":"https://github.com/drmick/rust-hashcash-ddos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmick%2Frust-hashcash-ddos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmick%2Frust-hashcash-ddos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmick%2Frust-hashcash-ddos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drmick%2Frust-hashcash-ddos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drmick","download_url":"https://codeload.github.com/drmick/rust-hashcash-ddos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217203,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ddos","hashcash","rust","tokio-rs"],"created_at":"2025-02-10T02:41:11.369Z","updated_at":"2025-04-04T17:20:46.624Z","avatar_url":"https://github.com/drmick.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Rust hashcash POW anti-ddos\n\nTo prevent a DDOS attack, we use the Hashcash algorithm for confirming the work of the client. The client will not be able to make a DDoS attack, since for each request it needs to calculate the hash, which takes time.\n\n1. Client generates a message\n2. Client appends a sequence to the message and hashes it using SHA256 until the first 20 bits of the hash are zero. This takes about a second. Because it is necessary to sort out several million hashes\n3. When the hash is solved, the client sends a message to the server.\n4. The server calculates a hash from the message. If the hash has the first 20 bits set to zero, then the message is considered valid.\n5. The server writes the hash from the message to the store so that the client cannot use it a second time\n6. The server returns a response to the client\n\n#### Launch server\n\n```\ndocker-compose -f docker-compose.server.yml build\ndocker-compose -f docker-compose.server.yml up\n```\n\n\n#### Launch client\n```\ndocker-compose -f docker-compose.client.yml build\ndocker-compose -f docker-compose.client.yml up\n```\n\n\n1. [server](server) Server side\n2. [client](client) Client side\n3. [lib](lib) Common lib\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmick%2Frust-hashcash-ddos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrmick%2Frust-hashcash-ddos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmick%2Frust-hashcash-ddos/lists"}