{"id":16890327,"url":"https://github.com/jedevc/hacksurrey-2019","last_synced_at":"2025-03-20T07:37:39.202Z","repository":{"id":95489185,"uuid":"169858335","full_name":"jedevc/hacksurrey-2019","owner":"jedevc","description":"3D print a physical SHA-256 hash","archived":false,"fork":false,"pushed_at":"2020-04-03T15:59:23.000Z","size":2954,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T13:52:28.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://devpost.com/software/hexblock","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jedevc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2019-02-09T11:07:37.000Z","updated_at":"2021-11-08T19:31:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f3a8850-8db9-4b11-bd0a-0b6f9bf8b6fa","html_url":"https://github.com/jedevc/hacksurrey-2019","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/jedevc%2Fhacksurrey-2019","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fhacksurrey-2019/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fhacksurrey-2019/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedevc%2Fhacksurrey-2019/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedevc","download_url":"https://codeload.github.com/jedevc/hacksurrey-2019/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244572379,"owners_count":20474430,"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-10-13T17:02:30.634Z","updated_at":"2025-03-20T07:37:39.182Z","avatar_url":"https://github.com/jedevc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hexblock\n\nIn previous hackathons, we've built software that does interesting things, but\nthis time we had access to a 3D printer :)\n\nOne idea that inspired us was [Git Trophy](https://gittrophy.com/), which\nallows you to print out your git commit history. Following on from that, we\ndedided to build an app that allows you to verify that you created a file,\nwhether that be a PDF, image or anything by creating a corresponding physical\nobject to represent.\n\n![Print of a SHA-256 hash](https://raw.githubusercontent.com/jedevc/hacksurrey-2019/master/print.jpg)\n\n## The process\n\n- Our app takes a file and uploads it to the server\n- The server hashes it using SHA-256, and stores it in a hash to file store\n- The app can then download a generated model and render of the hash\n- This hash can then be printed out using a 3D printer\n\n## The model design\n\nA typical hash is usually around 256 bits, or 32 bytes. Needless to say, that's\na reasonable quantity of data to represent in a 3D object.\n\nWe represent a block of data as a series of hexes, which we read from left to\nright. The left side is distinguished from the right side by a small triangle\nin the bottom left hand corner.\n\nEach hex represents a digit in base 720 and then the grid of 3 * 9 hexes\nrepresents a 27 digit number in base 720. Each hex is able to represent this\ndata by converting it's target number into a permutation, first using the\n[factoradic](https://en.wikipedia.org/wiki/Factorial_number_system) number\nsystem, and then easily converting that into an ordering. The heights of the\nsub-triangles in the hexagons are then arranged using the ordering.\n\nThe entire hash can be reconstructed by first interpreting all the digits by\nlisting out the height orders of the hexes, starting with 1 in the top left\ncorner and moving clockwise up till 6 in the bottom left corner. Then this\npermutation can be converted into a factoradic number, then back into a normal\nbase 10 number. Once we have performed this operation for all hexes, we can\nstring the digits together to create our original hash.\n\nYes, this is inpractical. Yes, it would take far too long to do. We know.\n\nBut it looks pretty :)\n\n## App\n\nWe tried to get the app to use the Guardtime KSI SDK to hash the data uploaded. The hash would then be sent to the server to be processed. Due to the type of Bouncy Castle Android uses, the SDK wouldn't work properly. We changed it so the app turns the file into bytes and sends the server the file in raw bytes, to be hashed there.\n\n![Hexblock Android app](android-app.png)\n\n## Team\n\nOur team was 2 people:\n\n- [Will Russell](https://github.com/wrussell1999): App building\n- [Justin Chadwell](https://github.com/jedevc): Web server, model printing\n\n## Tools\n\n- Android Studio (for our app)\n- Flask (for our web server)\n- SolidPython (for generating models)\n- OpenSCAD (for rendering models)\n- CURA (for processing our final model)\n\n## Running\n\nSimple to run:\n\n```bash\n$ git clone https://github.com/jedevc/hacksurrey-2019.git\n$ cd hacksurrey-2019.git\n$ pip install -r requirements.txt\n$ python -m hexblock.server\n```\n## License\n\nAll the code in this repository is licensed under the AGPL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedevc%2Fhacksurrey-2019","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedevc%2Fhacksurrey-2019","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedevc%2Fhacksurrey-2019/lists"}