{"id":51578756,"url":"https://github.com/systemslibrarian/crypto-lab-time-lock-puzzle","last_synced_at":"2026-07-11T03:32:24.706Z","repository":{"id":368077781,"uuid":"1283206069","full_name":"systemslibrarian/crypto-lab-time-lock-puzzle","owner":"systemslibrarian","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-28T23:36:21.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-29T01:15:42.144Z","etag":null,"topics":[],"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/systemslibrarian.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-28T17:00:58.000Z","updated_at":"2026-06-28T23:36:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/systemslibrarian/crypto-lab-time-lock-puzzle","commit_stats":null,"previous_names":["systemslibrarian/crypto-lab-time-lock-puzzle"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/systemslibrarian/crypto-lab-time-lock-puzzle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-time-lock-puzzle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-time-lock-puzzle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-time-lock-puzzle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-time-lock-puzzle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemslibrarian","download_url":"https://codeload.github.com/systemslibrarian/crypto-lab-time-lock-puzzle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-time-lock-puzzle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35350133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"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":[],"created_at":"2026-07-11T03:32:24.589Z","updated_at":"2026-07-11T03:32:24.695Z","avatar_url":"https://github.com/systemslibrarian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time-Lock Puzzles\n\nAn interactive, browser-only demonstration of the **Rivest–Shamir–Wagner (RSW) time-lock puzzle** — part of the [Crypto Lab](https://systemslibrarian.github.io/crypto-lab/) suite.\n\n## 1. What It Is\n\nA **time-lock puzzle** seals a message so that recovering it requires a fixed amount of *sequential* computation — work that cannot be meaningfully parallelised. This demo uses the RSW construction: pick an RSA-style modulus `N = p·q` and a base `a`; the answer is `b = a^(2^t) mod N`, reachable only by squaring `t` times in order (`xᵢ₊₁ = xᵢ² mod N`). The message itself is sealed with real **AES-256-GCM** under `SHA-256(b)`. Unlike ordinary encryption, there is no shared secret key — *anyone* can open it eventually; security comes from elapsed sequential time, tuned by the step count `t`. The factorisation of `N` is a trapdoor that lets the creator (and only the creator) open it instantly.\n\n## 2. When to Use It\n\n- **Sending data into the future / delayed disclosure** — escrow or dead-man switches where openability must not depend on trusting a custodian.\n- **Sealed-bid auctions** — bids that cannot be opened before a deadline, with no trusted auctioneer holding the plaintext.\n- **Randomness beacons \u0026 commit-reveal** — force a delay between fixing an input and learning the output so no one can grind the result.\n- **As the engine of a Verifiable Delay Function (VDF)** — the same squaring chain underlies Pietrzak/Wesolowski VDFs, which add a fast-to-check proof.\n- **When NOT to use it:** anything needing instant, key-based access control, or a *guaranteed wall-clock* delay — solve time scales with the *speed of one machine*, so faster hardware opens it sooner. Time-lock puzzles bound parallel speed-up, not absolute time.\n\n## 3. Live Demo\n\n**[systemslibrarian.github.io/crypto-lab-time-lock-puzzle](https://systemslibrarian.github.io/crypto-lab-time-lock-puzzle/)**\n\nType a secret, choose a difficulty (number of sequential squarings `t`) and modulus size, and generate a puzzle. Then solve it: watch the squarings accumulate in a Web Worker with live progress and a per-device time estimate. Contrast three openings — the **honest sequential solve**, a **cheat** that skips the work (rejected by AES-GCM, failing closed), and the **creator's trapdoor** that opens instantly via `φ(N)`. All cryptography runs in your browser with JavaScript `BigInt` + WebCrypto; nothing is sent to a server.\n\n## 4. How to Run Locally\n\n```bash\ngit clone https://github.com/systemslibrarian/crypto-lab-time-lock-puzzle\ncd crypto-lab-time-lock-puzzle\nnpm install\nnpm run dev\n```\n\nRun the test suite with `npm test` (25 tests covering the math, including the load-bearing invariant that the sequential solve equals the trapdoor open). No environment variables are required.\n\n## 5. Part of the Crypto-Lab Suite\n\n\u003e One of 60+ live browser demos at\n\u003e [systemslibrarian.github.io/crypto-lab](https://systemslibrarian.github.io/crypto-lab/)\n\u003e — spanning Atbash (600 BCE) through NIST FIPS 203/204/205 (2024).\n\n---\n\n*\"Whether you eat or drink, or whatever you do, do all to the glory of God.\" — 1 Corinthians 10:31*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-time-lock-puzzle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-time-lock-puzzle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-time-lock-puzzle/lists"}