{"id":23002593,"url":"https://github.com/vghxv/mac_ctf","last_synced_at":"2026-05-01T13:32:57.051Z","repository":{"id":265121054,"uuid":"895119942","full_name":"Vghxv/mac_ctf","owner":"Vghxv","description":"CTF challenge","archived":false,"fork":false,"pushed_at":"2024-12-28T18:16:55.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T05:24:50.229Z","etag":null,"topics":["cryptography","ctf","mac"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Vghxv.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-27T15:40:41.000Z","updated_at":"2024-12-28T18:16:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea9ea08c-bf4d-4fae-87d1-bf0e79c13e7e","html_url":"https://github.com/Vghxv/mac_ctf","commit_stats":null,"previous_names":["vghxv/mac_ctf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vghxv%2Fmac_ctf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vghxv%2Fmac_ctf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vghxv%2Fmac_ctf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vghxv%2Fmac_ctf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vghxv","download_url":"https://codeload.github.com/Vghxv/mac_ctf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246828477,"owners_count":20840474,"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":["cryptography","ctf","mac"],"created_at":"2024-12-15T07:11:29.626Z","updated_at":"2026-05-01T13:32:57.008Z","avatar_url":"https://github.com/Vghxv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MAC Forgery Challenge\n\n## Overview\n\nThis project implements a challenge to explore vulnerabilities in cryptographic Message Authentication Codes (MACs). Participants are tasked with forging a valid MAC for a given message. The challenge uses a Flask-based web application that provides two endpoints:\n\n1. `/mac`: Generates a MAC for a provided message.\n2. `/submit`: Allows submission of a forged MAC for validation.\n\n---\n\n## Setup and Execution\n\n### Running Locally\n\nClone the repository and navigate to the project directory. \n\n```bash\ndocker compose up -d\n```\n\n### Docker\n\n``` bash\ndocker pull vincent333/mac-ctf\ndocker run -d -t -p 5000:5000 --name mac-ctf vincent333/mac-ctf\n```\n\n---\n\n## Endpoints\n\n### `/mac` (POST)\n\nGenerates a MAC for the provided message.\n\n#### Request Body\n```json\n{\n    \"message\": \"your_message_here\"\n}\n```\n\n#### Response\n- **Success (200)**:\n  ```json\n  {\n      \"mac\": [\"r_hex\", \"t1_hex\", ..., \"td_hex\"]\n  }\n  ```\n- **Error (400)**:\n  ```json\n  {\n      \"error\": \"error_description\"\n  }\n  ```\n\n---\n\n### `/submit` (POST)\n\nSubmits a forged MAC for validation. The goal is to construct a valid MAC for a message not previously queried.\n\n#### Request Body\n```json\n{\n    \"mac\": [\"r_hex\", \"t1_hex\", ..., \"td_hex\"],\n    \"message\": \"your_message_here\"\n}\n```\n\n#### Response\n- **Success (200)**:\n  ```json\n  {\n      \"result\": \"Success! Here is your flag: FLAG{XXX}\"\n  }\n  ```\n- **Failure (400)**:\n  ```json\n  {\n      \"error\": \"error_description\"\n  }\n  ```\n- **Failure (200)**:\n  ```json\n  {\n      \"result\": \"Invalid MAC. Try again.\"\n  }\n  ```\n\n---\n\n### `/` (GET)\n\nProvides instructions for the challenge in HTML format.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvghxv%2Fmac_ctf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvghxv%2Fmac_ctf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvghxv%2Fmac_ctf/lists"}