{"id":50716909,"url":"https://github.com/systemslibrarian/crypto-lab-webauthn","last_synced_at":"2026-06-09T19:01:46.130Z","repository":{"id":363526223,"uuid":"1263728918","full_name":"systemslibrarian/crypto-lab-webauthn","owner":"systemslibrarian","description":"rowser-based WebAuthn/Passkeys demo — real ECDSA P-256 credential keys, challenge-response assertions signing origin+challenge+counter, phishing/replay/clone attacks all blocked. The private key never leaves the authenticator","archived":false,"fork":false,"pushed_at":"2026-06-09T09:28:18.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T10:12:13.389Z","etag":null,"topics":["authentication","challenge-response","crypto-lab","cryptography","ctap","ecdsa","fido2","p256","passkeys","passwordless","phishing-resistant","webauthn"],"latest_commit_sha":null,"homepage":"https://systemslibrarian.github.io/crypto-lab-webauthn/","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-09T08:03:56.000Z","updated_at":"2026-06-09T09:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/systemslibrarian/crypto-lab-webauthn","commit_stats":null,"previous_names":["systemslibrarian/crypto-lab-webauthn"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/systemslibrarian/crypto-lab-webauthn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-webauthn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-webauthn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-webauthn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-webauthn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemslibrarian","download_url":"https://codeload.github.com/systemslibrarian/crypto-lab-webauthn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-webauthn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34121022,"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-06-09T02:00:06.510Z","response_time":63,"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":["authentication","challenge-response","crypto-lab","cryptography","ctap","ecdsa","fido2","p256","passkeys","passwordless","phishing-resistant","webauthn"],"created_at":"2026-06-09T19:01:45.172Z","updated_at":"2026-06-09T19:01:46.115Z","avatar_url":"https://github.com/systemslibrarian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto-lab-webauthn\n\n## What It Is\n\nA faithful model of the WebAuthn / FIDO2 passkey ceremony using **real ECDSA P-256 signatures** via the browser's Web Crypto API. A simulated authenticator generates a credential keypair bound to a relying party (RP), keeps the private key inside itself, and produces signed assertions on demand. A simulated server registers the public credential and verifies each assertion against five contextual checks: a fresh challenge, the origin the browser actually saw, the RP ID hash, the ECDSA signature itself, and a monotonic counter for clone detection. The same engine then drives four attacks — a phishing site, a replayed assertion, a wrong-relying-party request, and a cloned authenticator — so you can watch the specific check each attack trips on. This is **not** the full CBOR/COSE/attestation wire format; it models the *security-relevant logic* of WebAuthn — the parts you'd review in a relying-party verifier — without the byte-level encoding work that production libraries already do.\n\n## When to Use It\n\n- **Teaching how passkeys actually log you in** — show the registration vs. authentication ceremonies without hand-waving over the math, because the page is doing real ECDSA P-256.\n- **Explaining *why* WebAuthn is phishing-resistant** — the \"Phishing site\" control signs with a look-alike origin and watches the server's Origin check reject it. That's the whole anti-phishing property, made visible.\n- **Auditing or building a relying-party verifier** — the five checks (challenge, origin, RP ID hash, signature, counter) are the same five your verifier has to run; here they are with passing/failing detail per row.\n- **Comparing passwords vs. passkeys in front of a non-cryptographer audience** — there is a shared-secret table you can point at, plus a working demo of \"no secret on the server\".\n- **Reference: in production, use these** — the platform `navigator.credentials.create` / `.get` APIs and a vetted server library (SimpleWebAuthn, py_webauthn, webauthn4j, fido2-net-lib). Use real attestation when you need it. This page is for learning.\n- **Do NOT use this demo's JSON authData / clientData encoding for anything** — it stands in for CBOR-encoded WebAuthn structures so the security logic is readable. The cryptography is real; the encoding is not.\n\n## Live Demo\n\n[**https://systemslibrarian.github.io/crypto-lab-webauthn/**](https://systemslibrarian.github.io/crypto-lab-webauthn/)\n\nThe page is built around a single register-then-authenticate flow followed by four attacks. **Create passkey** generates a fresh ECDSA P-256 keypair on the simulated authenticator and registers the public half with the simulated server. **Authenticate** issues a new challenge, signs `(challenge ‖ origin ‖ rpIdHash ‖ counter)`, and prints every server-side check with a pass/fail badge plus the verifier context (expectedChallenge, expectedOrigin, expectedRpId). The **Break it** controls re-run the ceremony four ways: **Phishing site** signs with `https://examp1e-login.com` while the server still expects `https://example.com` — the Origin check fails. **Replay** captures a valid assertion, verifies it once successfully, then verifies the same assertion against a fresh challenge — the Challenge check fails. **Wrong relying party** asks the authenticator for an assertion for `evil.com` — the authenticator itself refuses, and the server never sees a signature. **Cloned authenticator** lowers the counter on a fresh assertion to simulate a clone whose local count has fallen behind — the Counter check fails. A reset baseline button always restores a clean authentication so you can try the next attack.\n\n## How to Run Locally\n\n```bash\ngit clone https://github.com/systemslibrarian/crypto-lab-webauthn.git\ncd crypto-lab-webauthn\nnpm install\nnpm run dev      # local dev server with HMR\nnpm run build    # type-check + production build to dist/\nnpm run preview  # serve the built dist/ locally\n```\n\nNo environment variables, no API keys, no servers. Everything runs client-side in the browser against Web Crypto.\n\n## Part of the Crypto-Lab Suite\n\nThis is one demo in a wider portfolio of interactive cryptography labs — see [systemslibrarian.github.io/crypto-lab](https://systemslibrarian.github.io/crypto-lab/) for the rest, including the five PQC families overview, hybrid TLS, harvest-now-decrypt-later timelines, key-exchange generations, and deep-dives on individual schemes.\n\n---\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-webauthn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-webauthn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-webauthn/lists"}