{"id":21492296,"url":"https://github.com/cipherstash/pyconau2024-ctf","last_synced_at":"2026-02-04T01:35:41.458Z","repository":{"id":263665024,"uuid":"891055328","full_name":"cipherstash/pyconau2024-ctf","owner":"cipherstash","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-26T23:26:29.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T11:27:51.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","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/cipherstash.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":"2024-11-19T16:42:12.000Z","updated_at":"2024-11-26T23:26:29.000Z","dependencies_parsed_at":"2024-11-27T00:23:03.276Z","dependency_job_id":null,"html_url":"https://github.com/cipherstash/pyconau2024-ctf","commit_stats":null,"previous_names":["cipherstash/pyconau2024-ctf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cipherstash/pyconau2024-ctf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherstash%2Fpyconau2024-ctf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherstash%2Fpyconau2024-ctf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherstash%2Fpyconau2024-ctf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherstash%2Fpyconau2024-ctf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cipherstash","download_url":"https://codeload.github.com/cipherstash/pyconau2024-ctf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cipherstash%2Fpyconau2024-ctf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263550755,"owners_count":23478866,"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":[],"created_at":"2024-11-23T15:28:06.276Z","updated_at":"2026-02-04T01:35:41.387Z","avatar_url":"https://github.com/cipherstash.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyCon 2024 Capture the Flag (CTF)\n\nWelcome to the PyCon 2024 Capture the Flag game! This environment uses [PostgreSQL](https://www.postgresql.org/) and [CipherStash](https://cipherstash.com/) to encrypt data in use.\nThe database has been initialized with [Encrypt Query Language](https://github.com/cipherstash/encrypt-query-language) (EQL) and seeded with the encrypted flag.\nThe Python applications uses the [eqlpy](https://github.com/cipherstash/eqlpy) library to interact with the EQL payloads.\n\n## Requirements\n\n- [Docker](https://www.docker.com/) installed and running\n- [Docker Compose](https://docs.docker.com/compose/) installed\n- Python 3.x for interacting with the application\n- Keys provided at the CipherStash booth\n\n## Environment overview\n\nThis environment includes:\n\n1. PostgreSQL database: Runs on `localhost:5432`.\n2. CipherStash Proxy: Intercepts database traffic to handle encryption and decryption, running on `localhost:6432`.\n\nTo successfully query and decrypt data:\n\n- All database traffic must go through the CipherStash Proxy.\n- Use the provided encryption keys to access decrypted results.\n\nYou can view the previously executed SQL commands to initialize the database [here](sql/init.sql).\n\n## Getting started\n\n### 1. Clone the repo\n\n```bash\ngit clone https://github.com/cipherstash/pyconau2024-ctf.git\ncd pyconau2024-ctf\n```\n\n### 2. Start the environment\n\nRun the following command to start PostgreSQL and the CipherStash Proxy:\n\n```bash\ndocker compose up --build\n```\n\nThis will:\n\n- Start the PostgreSQL database (`localhost:5432`) and initialize the database with the seeded data.\n- Start the CipherStash Proxy (`localhost:6432`).\n\n### 3. Running the Python application\n\nTo run the Python application, run the following command:\n\n```bash\n# install dependencies\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n\n# run the app\npython main.py\n```\n\nThe application will query the database and print the results to the console.\nIf this is the first time running the application, you should see the following output:\n\n```bash\nCiphertext: ...\n```\n\nOnce you solve the challenge, you should see the following output:\n\n```bash\nPlaintext: ...\n```\n\n### 4. Obtain your keys\n\nVisit the CipherStash booth to receive your decryption keys.\nThey will provide you a link to download the contents for your `.envrc` file.\n\n---\n\n## How to solve the challenge\n\n1. Open the `.envrc` file and update the values with your keys.\n1. Update the Python application to query the database via the Proxy.\n2. Run the application to query the database and view the plaintext decrypted results.\n\n## Flag submission\n\nOnce the challenge is solved, submit the flag to [this form](https://forms.gle/sQkc9WktakrJeekUA).\n\n\u003e Hint: The flag is the plaintext value of the `key` column in the `pycon_cta` table.\n\n## Troubleshooting\n\n- Can’t connect to the database?\n  - Ensure the Proxy is running (`localhost:6432`).\n  - Check your application’s connection settings.\n- Decryption issues?\n  - Verify you’re using the correct keys from the CipherStash booth.\n  - Ensure database traffic is routed through the Proxy.\n\n## Support\n\nFor help, visit the CipherStash booth to connect with our team.\n\n---\n\nHave fun and good luck decrypting the flag! 🚩\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipherstash%2Fpyconau2024-ctf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcipherstash%2Fpyconau2024-ctf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcipherstash%2Fpyconau2024-ctf/lists"}