{"id":20255237,"url":"https://github.com/hjfitz/disparp-mtp-cracker","last_synced_at":"2025-07-29T05:33:22.538Z","repository":{"id":75400740,"uuid":"181176801","full_name":"hjfitz/disparp-mtp-cracker","owner":"hjfitz","description":"\"one-time pad on the back of your pinto is redneck\" - Bruce Potter, 2012","archived":false,"fork":false,"pushed_at":"2019-04-26T10:32:32.000Z","size":1256,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T17:39:32.646Z","etag":null,"topics":["dictionary-attack","distributed","one-time-pad","parallel","ts-node","typescript","worker-threads"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hjfitz.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":"2019-04-13T13:40:42.000Z","updated_at":"2019-04-26T10:32:33.000Z","dependencies_parsed_at":"2023-06-06T09:31:09.229Z","dependency_job_id":null,"html_url":"https://github.com/hjfitz/disparp-mtp-cracker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hjfitz/disparp-mtp-cracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjfitz%2Fdisparp-mtp-cracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjfitz%2Fdisparp-mtp-cracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjfitz%2Fdisparp-mtp-cracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjfitz%2Fdisparp-mtp-cracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hjfitz","download_url":"https://codeload.github.com/hjfitz/disparp-mtp-cracker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hjfitz%2Fdisparp-mtp-cracker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267633670,"owners_count":24118777,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dictionary-attack","distributed","one-time-pad","parallel","ts-node","typescript","worker-threads"],"created_at":"2024-11-14T10:37:33.220Z","updated_at":"2025-07-29T05:33:22.507Z","avatar_url":"https://github.com/hjfitz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [DISPARP] Distributed Systems and Parallel Programming - Coursework Project\n\u003e University of Portsmouth, Year 3 Coursework\n\n## Many-time Pad Reuse brute-forcing\nThis repo has code for both a distributed and parallel (via worker_threads) for breaking ciphertexts enciphered using OTP and a repeated dictionary work as a key.\n\n## Requirements\nOnly Node and NPM are required to use this program. The dictionary is given (although you can replace this!)\n* Node: \u003e= 11\n* NPM: \u003e= 6.4.1\n* Yarn (preferred over NPM): \u003e= 1.12.3\n\n## Usage\n0. Install all dependencies `npm install`\n1. Build the TypeScript source code to JS: `npm run build`\n2. Run the code:\n\t* For the distributed version, stand up the server with `npm run start:cluster-naster 2`. The number of clients required is the first argument - defaulting to 2.\n\t* Stand up clients with `npm run start:cluster-client-client 192.168.0.12:5000`. The only argument defines where the server is hosted.\n\t* For the parallel version, run `npm run start:threaded 2`. The only argument is the number of threads to spawn.\n\t* To run the worker farm code, prepend the aforementioned commands with `farm-`, `npm run start:farm-cluster-worker` etc.\n\n## Tech\nBoth versions run the same way. Clients are invoked with arguments:\n* nodes in the pool\n* node number\n* ciphertext\nNodes then get their words from a local dictionary and split this by their calculated block size, and their position (Block size = wordlist length / number of nodes).\nNodes iterate through this, calculating (ciphertext ^ word). If the result is readable (defined by some regex: `/^[a-zA-Z0-9\\., \\'\\\"\\-_\\:\\(\\)]+$/`) then the key and decoded, readable, ciphertext is sent back to the host. If these two the CT and Key defined by the host, the program exits.\n\n### Distributed\nA websocket server waits for the desired amount of clients. Upon reaching this number, a 'begin' event is sent to each client, as well as their number, size and ciphertext (defined by the interface in lib/shared.ts). Nodes do their brute-force loop and send back any candidates.\n\n### Threaded\nUsing `worker_threads`, threads are spawned according to the argument given to `threaded.js`. Worker threads are spawned with the `new Worker(workerfile, workerData)` constructor. Amount of threads, thread position and ciphertext is sent in workerData.\n\n## Results\nAvailable on [Google Sheets](https://docs.google.com/spreadsheets/d/1rfd0MSvlGD4TiAJzQ9l7tq3FgKl0P2Nm5BpdcP8GT0Q/edit#gid=1020168994)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjfitz%2Fdisparp-mtp-cracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjfitz%2Fdisparp-mtp-cracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjfitz%2Fdisparp-mtp-cracker/lists"}