Zero-Trust Proof-of-Presence with Flutter & Supabase

What if a simple QR code could cryptographically prove you stood at a doorstep, serving papers, unalterable forever? One dev just built it for Morocco's huissiers de justice using Flutter and Supabase.

Proving Presence with Crypto: A Flutter App That Locks Down Judicial Proofs — theAIcatchup

Key Takeaways

  • On-device crypto in Dart Isolates enables tamper-proof presence proofs without server trust.
  • AES-GCM + SHA-256 bind GPS/time/files, verifiable offline via QR codes.
  • Flutter + Supabase combo scales for judicial and field service verifications globally.

Flutter developers have been churning out slick UIs for years, but zero-trust proof-of-presence protocols? That’s new territory.

What folks expected was another location-checkin app—snap a photo, tag GPS, upload to the cloud, done. Easy server-side verification, maybe a blockchain timestamp for flair. But here’s the twist: this QRPruf system, built for Morocco’s huissiers de justice, demands cryptographic certainty that you’re there, then, with untampered evidence. No trusting the network, no server meddling. It changes everything for legal tech in high-stakes fields like document serving.

Look.

Judicial officers can’t just WhatsApp a selfie. That act of physical presence binds contracts, evictions, court orders. Tamper once, and lawsuits crumble. So the architect—call him the crypto tinkerer—went full zero-trust: all heavy lifting on-device, in a Dart Isolate, server reduced to a dumb verifier.

And it works because AES-GCM isn’t just encryption; it’s a tamper tripwire.

Why On-Device Crypto Crushes Cloud Hype

Servers lie. Or get hacked. Or collude. That’s the zero-trust gospel, right? But implementing it in Flutter? Ballsy. The ProofCryptoService singleton spins up via compute(), sequestering SHA-256 hashing and AES-GCM encryption away from the UI thread. For a 50MB video—think officer filming a door-knock refusal—no OOM crashes, no frozen screens.

Bytes read from file. Hash pre-encryption. Random 96-bit IV. GCM mode seals it: confidentiality plus authentication tag. Flip one byte post-encrypt? Decryption explodes. Beautiful.

The critical design decision: the server never sees the original files, only the encrypted blobs and their hashes.

That’s the quote that hooked me. Pure architecture porn. Supabase Edge Functions? Mere janitors—verify canonical JSON hash (sorted, SHA-256’d for determinism), sign a cert, stash blobs. Payload binds GPS, device time, subject ID, item hashes. QR code spits out the shareable proof. Anyone scans, verifies offline. No network necromancy.

But wait—why Flutter for this? Cross-platform dreams aside, Dart’s Isolate model is underrated gold for crypto workloads. Shared heap? Nope. Memory isolation prevents leaks, duplication. Mocktail tests mock the whole shebang, ensuring isolates don’t hallucinate.

Short version: it’s tamper-evident by design.

Is Flutter Ready for Zero-Trust Security Primitives?

Skeptics scoffed at first. Flutter’s a UI framework, not a crypto fortress. Yet here it is, wielding encrypt package like a pro, IV-prepended ciphertexts written straight to disk. Skip encryption for massive videos? Smart OOM dodge—hash-only mode keeps proofs lean.

The verifier? Pure Dart bliss. Canonicalize proof JSON—proof_id, timestamps, hashes, sorted keys—hash it, match against cert. No deps, no platform BS. Run it in any Dart env.

This isn’t hype. It’s a blueprint. My unique take: echoes early PGP email signing in the ’90s—user-controlled keys democratizing trust. Back then, it killed central CA monopolies; today, QRPruf could gut shady notarization mills in emerging markets. Prediction: copycats in real estate, insurance claims by 2025. Legal tech’s dusty; this injects crypto rigor without blockchain bloat.

Flutter’s event loop stays buttery. compute() offloads the grind—Dart VM spawns isolate, top-level func executes, message-passes result. For AES on large files, it’s surgical.

GCM (Galois/Counter Mode) provides both confidentiality and authentication. If a single byte of the encrypted file is changed after encryption, decryption throws an exception — the authentication tag fails.

Spot on. GCM’s the why here—not CBC’s malleability nightmares.

How Supabase Fits Without Stealing the Show

Supabase? Not the star, but the reliable sidekick. Edge Functions handle cert issuance post-hash-check. Storage buckets cradle encrypted blobs. Auth ties subject_id. Zero-trust means server verifies, doesn’t compute. No raw files touch it—huge for GDPR-ish compliance in legal land.

Implementation snippet? The _encryptIsolate func: read bytes sync (isolate’s fine), hash, encrypt, write IV|ciphertext. base64 key from args. Temp paths via path_provider. Clean, no RAM hogs.

Wander a sec: Morocco’s context amps stakes. Huissiers face disputes daily—‘You weren’t there!’ Proofs must stand solo in court. QR code? Genius for paper-heavy bureaucracies. Scan, verify, print.

Critique time. Corporate PR spin? None here—this is indie dev flex. But Supabase’s edge funcs could bottleneck at scale; watch query costs on blob uploads.

Why Does Proof-of-Presence Matter Beyond Courts?

Scales wide. Delivery apps proving drop-offs. Field service techs logging repairs. Activists timestamping protests. Anytime ‘I was here’ needs teeth.

Architectural shift: moves from trust-minimized servers to user-sovereign devices. Flutter proves mobile can shoulder crypto without native FFI hacks. Supabase? Proves Postgres+storage scales for certs without AWS lock-in.

Bold call: this forks legal software toward Web3-lite. No tokens, just proofs. Historical parallel? Digital signatures in ‘95 killed fax fraud; this kills ‘photoshopped presence’.

Tests? Mocktail mocks files, keys—isolates too. Ensures hash determinism, tag integrity.

Deep breath.

It’s ready for prod.


🧬 Related Insights

Frequently Asked Questions

What is zero-trust proof-of-presence?

It’s on-device crypto binding GPS, time, and file hashes into tamper-proof certs, with servers only verifying—no originals exposed.

How does Flutter handle large file encryption?

Via Dart Isolates with compute(): hashes and AES-GCM run off UI thread, writing directly to disk to dodge memory spikes.

Can anyone verify QRPruf proofs without the app?

Yes—pure Dart verifier checks canonical hashes offline, no network or platform ties needed.

James Kowalski
Written by

Investigative tech reporter focused on AI ethics, regulation, and societal impact.

Frequently asked questions

What is zero-trust proof-of-presence?
It's on-device crypto binding GPS, time, and file hashes into tamper-proof certs, with servers only verifying—no originals exposed.
How does Flutter handle large file encryption?
Via Dart Isolates with compute(): hashes and AES-GCM run off UI thread, writing directly to disk to dodge memory spikes.
Can anyone verify QRPruf proofs without the app?
Yes—pure Dart verifier checks canonical hashes offline, no network or platform ties needed.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by Dev.to

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.