{"id":51578764,"url":"https://github.com/systemslibrarian/crypto-lab-lwe-hints","last_synced_at":"2026-07-11T03:32:24.998Z","repository":{"id":364868181,"uuid":"1269268938","full_name":"systemslibrarian/crypto-lab-lwe-hints","owner":"systemslibrarian","description":"Browser demo of approximate-hint LWE secret recovery on sparse ternary secrets. Computes hint counts; runs no attack. ePrint 2026/1081.","archived":false,"fork":false,"pushed_at":"2026-06-28T02:04:24.000Z","size":547,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T02:18:42.911Z","etag":null,"topics":["bkz","crypto-lab","cryptography","cryptography-education","ddgr","lattice-cryptography","lattice-estimator","learning-with-errors","lwe","lwe-with-hints","post-quantum-cryptography","side-information"],"latest_commit_sha":null,"homepage":"https://systemslibrarian.github.io/crypto-lab-lwe-hints/","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-14T14:02:42.000Z","updated_at":"2026-06-28T02:04:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/systemslibrarian/crypto-lab-lwe-hints","commit_stats":null,"previous_names":["systemslibrarian/crypto-lab-lwe-hints"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/systemslibrarian/crypto-lab-lwe-hints","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-lwe-hints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-lwe-hints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-lwe-hints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-lwe-hints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemslibrarian","download_url":"https://codeload.github.com/systemslibrarian/crypto-lab-lwe-hints/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-lwe-hints/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":["bkz","crypto-lab","cryptography","cryptography-education","ddgr","lattice-cryptography","lattice-estimator","learning-with-errors","lwe","lwe-with-hints","post-quantum-cryptography","side-information"],"created_at":"2026-07-11T03:32:24.894Z","updated_at":"2026-07-11T03:32:24.993Z","avatar_url":"https://github.com/systemslibrarian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto-lab-lwe-hints\n\n## What It Is\n\nAn educational estimator of how many side-channel **hints** are needed to recover a **sparse-ternary LWE secret** — under the `O(h·log₂h)` law of ePrint 2026/1081 versus the prior `O(n)` threshold. It runs **no attack**.\n\nThis demo teaches one result from Hhan, Hong, Kim, Lee, and Lee, *\"From Perfect\nto Approximate Hints: Efficient LWE Secret Recovery Leveraging Low Hamming\nWeight\"* ([IACR ePrint 2026/1081](https://eprint.iacr.org/2026/1081)).\n\nLWE (Learning With Errors) underpins lattice post-quantum crypto and FHE. For\nefficiency, FHE often uses **sparse ternary secrets**: `s ∈ {−1, 0, +1}ⁿ` with\nonly `h` nonzero entries (`h ≪ n`). A side channel can leak **hints** — linear\nequations about `s`:\n\n- **perfect hint:** `l = ⟨v, s⟩`\n- **approximate hint:** `l = ⟨v, s⟩ + e` (small error `e`)\n\n**The result.** Prior work needed `≈ n/2` perfect/modular hints (an `O(n)`\nthreshold). This paper shows — empirically, under the **Gaussian Approximation\nAssumption (GAA)** — that only `O(h·log₂h)` hints suffice. For the FHE anchor\n`(n, h) = (2¹⁵, 32)` that is **320 hints instead of 16,384 — a ~50× drop.**\n\nThe demo *computes* these counts with plain arithmetic\n(`C·h·log₂h` vs `n/2`, with `C = 2` derived from the paper's anchor). It is a\n**leakage-assisted secret-recovery estimator, not an attack**: no lattice\nreduction, no side channel, no randomness, no network. Same input ⇒ same output.\nEvery number is auditable in [`src/model.ts`](src/model.ts) and\n[`PAPER-NOTES.md`](PAPER-NOTES.md).\n\n\u003e ✅ **Verification.** The paper (`2026-1081.pdf`) is committed, and `C = 2`\n\u003e reproduces **every row of Table 1** — all four Hamming weights\n\u003e `h ∈ {32, 64, 128, 192} → {320, 768, 1792, 2913}` and the prior `n/2` baseline\n\u003e across `n ∈ {2¹⁴, 2¹⁵, 2¹⁶}`. Full transcription in `PAPER-NOTES.md`; remaining\n\u003e assumptions in the in-app **Known Gaps** panel and `BUILD-NOTES.md`.\n\n## When to Use It\n\n- To understand **why sparse secrets are a liability** under side-channel leakage.\n- To estimate, for a given `(n, h)` and a leakage rate, **whether a deployment\n  accumulates enough hints** to cross the new-method threshold.\n- As a teaching aid for the difference between **perfect** and **approximate**\n  hints and between `O(n)` and `O(h log h)` scaling.\n- Do NOT treat this as a cryptanalysis tool or a security assessment of any concrete\n  system — it is an educational estimator, and \"recoverable\" here means only that\n  *the paper's hint budget is met*, nothing more.\n\n## Live Demo\n\n**[systemslibrarian.github.io/crypto-lab-lwe-hints](https://systemslibrarian.github.io/crypto-lab-lwe-hints/)**\n\nState is deep-linkable via the query string, e.g.\n`?h=32\u0026nexp=15` reproduces the paper anchor. Adjust `(n, h)` and the leakage\nassumptions to watch the `O(h·log₂h)` hint budget move against the prior `n/2`\nbaseline, with every figure computed by the auditable `src/model.ts`.\n\n## What Can Go Wrong\n\n- **Low Hamming weight is a double edge** — choosing very small `h` for FHE efficiency is exactly what makes the secret cheap to recover once hints leak; the `O(h·log₂h)` budget shrinks as `h` shrinks.\n- **Approximate vs perfect hints differ** — hints carrying error are weaker per-hint than perfect hints, so a deployment can reach \"enough\" leakage faster or slower than a naive count implies.\n- **The result rests on the GAA** — the `O(h·log₂h)` law is empirical under the Gaussian Approximation Assumption; outside the regimes the paper validates, the estimate may not hold.\n- **Hint budget met ≠ key recovered** — crossing the threshold is necessary, not sufficient; actual recovery still requires running lattice reduction, which this tool deliberately does not do.\n- **Old margins over-estimate safety** — assuming the prior `O(n)` (`≈ n/2`) threshold over-states how much leakage a sparse-secret deployment can tolerate.\n\n## Real-World Usage\n\n- **Sparse ternary secrets** are standard in FHE libraries (HElib, Microsoft SEAL, OpenFHE) for CKKS/BFV/BGV performance.\n- **LWE and Module-LWE** underpin lattice post-quantum standards such as ML-KEM (FIPS 203) and ML-DSA (FIPS 204).\n- **Side-channel leakage of linear hints** about a secret is a documented threat model against lattice implementations.\n- **The modeled result** is from Hhan, Hong, Kim, Lee \u0026 Lee (IACR ePrint 2026/1081), which informs how conservatively to choose Hamming weight.\n\n## How to Run Locally\n\n```bash\ngit clone https://github.com/systemslibrarian/crypto-lab-lwe-hints\ncd crypto-lab-lwe-hints\nnpm install\nnpm run dev\n```\n\nRequires Node 20+. No runtime dependencies. Additional scripts:\n\n```bash\nnpm test        # run the pinned paper-anchor invariants\nnpm run build   # production build into dist/\nnpm run preview # preview the production build\n```\n\n## Related Demos\n\n- [crypto-lab-lll-break](https://systemslibrarian.github.io/crypto-lab-lll-break/) — LLL/BKZ lattice reduction on toy LWE, the attack this estimator stops short of.\n- [crypto-lab-syndrome-drain](https://systemslibrarian.github.io/crypto-lab-syndrome-drain/) — sibling single-result estimator in the same house style.\n- [crypto-lab-lattice-fault](https://systemslibrarian.github.io/crypto-lab-lattice-fault/) — physical side channels that produce the kind of leakage modeled here.\n- [crypto-lab-frodo-vault](https://systemslibrarian.github.io/crypto-lab-frodo-vault/) — plain-LWE KEM that grounds the LWE intuition.\n- [crypto-lab-scloud-vault](https://systemslibrarian.github.io/crypto-lab-scloud-vault/) — an LWE KEM that also uses ternary secrets.\n\n## About the Suite\n\nThis is one of the **crypto-lab** demos — small, auditable, single-result\neducational tools in a shared house style (Vite + TypeScript, a pure\ndeterministic `src/model.ts`, pinned tests, progressive-disclosure UI, dark\ndefault, honesty badges).\n\n---\n\n*One of 120+ browser demos in the [Crypto Lab](https://crypto-lab.systemslibrarian.dev/) suite.*\n\n*\"So whether you eat or drink or whatever you do, do it all for the glory of God.\" — 1 Corinthians 10:31*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-lwe-hints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-lwe-hints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-lwe-hints/lists"}