Branchwell

BioLock / source · biolock.dev / commits / ca434489

Name it BioLock new

written by Moontrace · ca4344897262c36de86cc3c37d2f69413751f189 · parent 6e78aa17

5 files changed

README.md changed

1- # Moontrace fingerprint sign-in
1+ # BioLock
22
3- Sign in with your own fingerprint or face. That is the only way: no passwords, no security keys,
3+ BioLock: sign in with your own fingerprint or face. That is the only way: no passwords, no security keys,
44 no QR codes, no phone-to-computer sign-in. A Moontrace project, public domain (Unlicense).
55
6- Live: https://moontrace.ai/fingerprint/ · Demo: https://moontrace.ai/fingerprint/demo/
6+ Live: https://moontrace.ai/biolock/ · Demo: https://moontrace.ai/biolock/demo/
77
88 ## How it works
99

demo/app.js changed

44 import * as C from '../code/client.js';
55
66 const rpId = location.hostname, origin = location.origin;
7- const DB = 'moontrace-fingerprint-demo';
7+ const DB = 'biolock-demo';
88 const db = () => { try { return JSON.parse(localStorage.getItem(DB) || '{"creds":[]}'); } catch { return { creds: [] }; } };
99 const put = (v) => { try { localStorage.setItem(DB, JSON.stringify(v)); } catch { /* private mode */ } };
1010 const $ = (s) => document.querySelector(s);
⋯
3030
3131 $('#fp-add').onclick = async () => {
3232 try {
33- const opts = S.registrationOptions({ rpId, rpName: 'Moontrace fingerprint sign-in demo', userName: 'demo', displayName: 'Demo member', excludeIds: C.enrolledOnThisDevice(rpId) });
33+ const opts = S.registrationOptions({ rpId, rpName: 'BioLock demo', userName: 'demo', displayName: 'Demo member', excludeIds: C.enrolledOnThisDevice(rpId) });
3434 const cred = await C.enrollThisDevice(opts);
3535 const rec = await S.verifyRegistration({ credential: cred, expectedChallenge: opts.challenge, expectedOrigin: origin, rpId });
3636 rec.name = ($('#fp-name').value || '').trim() || 'This device';

src/client.js changed

1- // Moontrace fingerprint sign-in: browser side.
1+ // BioLock: browser side.
22 // Sign in with this device's own fingerprint or face reader. Nothing else: no security keys,
33 // no QR codes, no phone-to-computer sign-in. Uses the browser's W3C Web Authentication API,
44 // limited to the built-in reader. Public domain (Unlicense).
55
6- const KEY = 'moontrace-fingerprint:enrolled-here';
6+ const KEY = 'biolock:enrolled-here';
77
88 function toB64u(buf) {
99 const b = new Uint8Array(buf); let s = '';

src/server.js changed

1- // Moontrace fingerprint sign-in: server side.
1+ // BioLock: server side.
22 // Sign in with the fingerprint or face reader built into your own device. Nothing else:
33 // no passwords, no security keys, no QR codes, no phone-to-computer sign-in.
44 // Under the hood it uses the W3C Web Authentication standard, because that is the only way

test/server.test.js changed

8787 const stored = await S.verifyRegistration({ credential: await k.create(ro), expectedChallenge: ro.challenge, expectedOrigin: ORIGIN, rpId: RP });
8888 const so = S.signInOptions({ rpId: RP });
8989 await assert.rejects(S.verifySignIn({ credential: await k.get(so), stored, expectedChallenge: 'other', expectedOrigin: ORIGIN, rpId: RP }), /challenge/);
90- await assert.rejects(S.verifySignIn({ credential: await k.get(so, { flags: 0x01 }), stored, expectedChallenge: so.challenge, expectedOrigin: ORIGIN, rpId: RP }), /fingerprint/);
90+ await assert.rejects(S.verifySignIn({ credential: await k.get(so, { flags: 0x01 }), stored, expectedChallenge: so.challenge, expectedOrigin: ORIGIN, rpId: RP }), /biolock/);
9191 const bad = await k.get(so); const sig = S.fromB64u(bad.response.signature); sig[10] ^= 1; bad.response.signature = S.toB64u(sig);
9292 await assert.rejects(S.verifySignIn({ credential: bad, stored, expectedChallenge: so.challenge, expectedOrigin: ORIGIN, rpId: RP }), /signature/);
9393 k.setCounter(5);

Browse files at this commit