Official documentation for physics-based MITM detection using the speed of light on Cloudflare Workers.
ExploreQuantum-Safe Optical Latency detects MITM attacks using the speed of light in fiber — open the dashboard and run your first probe in under a minute.
Deploy the Worker, open the Global Radar Dashboard, and watch live verdicts. Every request is triangulated against three edge nodes and scored against a physical baseline.
Load quantum-safe-dashboard.html. Status chip shows ● LIVE when the Worker responds.
Refresh or wait for auto-probe (every 8s). Verdict, risk score, and map update together.
SAFE_HUMAN or HACKER_DETECTED_MITM with measured RTT, baseline, and variance.
Rule: Keep the Worker URL correct in the dashboard script — CORS and live data depend on it.
Light in fiber travels at ~0.67c. Distance sets a hard minimum RTT — anything slower is suspect.
We compute geographic distance (haversine), convert to fiber time, add routing buffer, and compare measured RTT. Extra latency from proxies or MITM creates a variance spike.
Baseline ≈ (km × 2) / (0.67 × c) plus a small routing buffer in milliseconds.
Three random global nodes measure RTT; average and max delta feed the anomaly score.
If variance exceeds the safe buffer → HACKER_DETECTED_MITM; otherwise SAFE_HUMAN.
Rule: Physics sets the floor — software cannot travel faster than light in fiber.
One endpoint powers the dashboard and SDK — GET /api/check returns verdict, deltas, nodes, and metadata.
Call the Worker from any origin (CORS enabled). Response includes verdict, avgDeltaMs, varianceScore, selectedNodes, and more.
GET only. OPTIONS is handled for preflight. Health: /health.
Use verdict, varianceScore, measurements, clientCountry, colo.
Worker writes each check asynchronously — dashboard reads live history.
Rule: Always send CORS headers from the Worker or browsers will block the dashboard.
Global radar map, live verdict banner, risk bar, latency chart, logs, and SDK installer in one Google-clean UI.
Header chips show LIVE status, country, risk, and session probes. Dark mode, docs link, and force-refresh are always available.
Green SAFE_HUMAN or blinking red HACKER banner with measured / baseline / variance / risk.
Baseline stays flat; measured line spikes red on MITM. Timeline bars mark threats.
CSV / JSON export and fullscreen radar that copies the live mesh.
Rule: Mobile uses bottom nav (Map · Status · Logs · SDK) — desktop layout stays two-column.
Risk 0–100 blends variance, anomaly flag, time-of-day, proxy confidence, Tor, and high-risk ASN signals.
Green bar = low risk, orange mid, red high. Extra intel line shows Proxy %, Tor, ASN, unusual hour, multi-hop.
Score starts from variance × 1.8, capped 0–100. HACKER verdict floors at 72.
2–5 AM traffic, Tor ASN, known hosting ASN, and multi-hop delta boost risk.
Per-country baseline is smoothed in localStorage and shown as “Learned XXms”.
Rule: High risk does not always mean block — use it with verdict and context.
Three edge nodes form a live triangle. User or threat marker, animated packet paths, and optional heatmap dots.
Street / Satellite / Light layers. Fullscreen radar copies the same mesh so you never see an empty map.
computer = edge · server_person = you · threat_intelligence = threat.
Dashed triangle edges scroll continuously; packet paths run user → nodes.
Cards under the chart show Online / Degraded and approximate ms per node.
Rule: Use free OSM / Esri tiles only — no API key required.
Live table of every probe — time, country, measured, baseline, variance, risk, verdict. Click a row for full detail.
Worker also writes to D1 so history survives reloads. Export CSV or JSON anytime.
Newest first. SAFE / HACKER badges and color-coded risk.
Click any row → modal with full timestamp, numbers, and verdict.
CSV and JSON buttons download the current in-browser history.
Rule: D1 schema must match the Worker INSERT or logs will fail silently.
One package and one middleware line to protect any site with the same physics check.
Copy from the dashboard SDK card or use the snippets below. Point endpoint at your Worker.
Add the package to your Node / Edge project.
Place it early so every request is checked before your handlers.
Block, challenge, or log when verdict is HACKER_DETECTED_MITM.
Rule: Always use your own Worker URL — never hard-code a demo subdomain in production.
CORS, security headers, Durable Objects, free-plan migrations, and threat signals that harden the system.
Worker returns Access-Control-Allow-Origin: *, nosniff, DENY frame, no-store cache. Durable Object uses new_sqlite_classes for free plan.
Handle OPTIONS; attach CORS and security headers on every response.
Migration tag with new_sqlite_classes = ["LatencyMesh"] for free plan.
Proxy confidence, Tor ASN, bad ASN, multi-hop, and unusual-hour flags enrich the score.
Rule: Never expose secrets in the dashboard — only public Worker URLs and read-only verdicts.