PricingDemo
Log InGet API Key
H33-128H33-CKKSH33-256H33-FHE-IQH33-TFHEFHE OverviewH33-CompileZK LookupsBiometricsH33-3-KeyH33-MPCZK-TrustlessZK-PhishZK-VerifyPQC ArchitecturePQ VideoStorage EncryptionAI DetectionEncrypted Search
Security · 8 min read

Liveness Detection Techniques for
Biometric Authentication

How liveness detection prevents presentation attacks in biometric systems. Passive, active, and FHE-encrypted approaches compared with real-world accuracy data.

~42µs
Auth Latency
2.17M/s
Throughput
Encrypted
Liveness Check
Zero
Plaintext

Biometric authentication is only as strong as its ability to distinguish a living person from a forgery. Liveness detection—also called presentation attack detection (PAD)—is the critical layer that separates production-grade biometric systems from those vulnerable to trivially cheap spoofing. A printed photograph, a looping video on a tablet screen, a silicone mask molded from a 3D scan, or a GAN-generated deepfake injected at the camera driver level: each of these represents a distinct class of presentation attack, and each requires a different detection strategy. Without robust liveness detection, biometric authentication is theater—a system that authenticates images, not people.

The stakes are not abstract. In 2025, presentation attacks accounted for an estimated 18% of biometric fraud attempts across the financial sector. The attack surface is expanding: consumer-grade deepfake tools can generate photorealistic face swaps in real time, and injection attack toolkits that bypass camera APIs entirely are available as open-source projects. Any biometric system deployed without layered liveness detection is operating on borrowed time.

Key Insight

Liveness detection is not a single technique—it is a layered defense. No single signal (blink detection, texture analysis, depth mapping) is sufficient against the full spectrum of presentation attacks. Production systems must fuse multiple signals and, critically, must perform this fusion on encrypted data so that compromise of the verification server does not leak raw biometric frames.

Passive vs Active Liveness Detection

Liveness detection methods divide into two broad categories: passive and active. Each has distinct strengths, failure modes, and user experience implications. Understanding both is essential for architects designing biometric authentication pipelines.

Passive Liveness Detection

Passive liveness operates without requiring any deliberate action from the user. The system analyzes the captured biometric sample—typically a single frame or short video clip—for artifacts that distinguish a live face from a presentation attack instrument (PAI). The user simply looks at the camera. There is no instruction to blink, turn their head, or speak a phrase.

The core techniques in passive liveness include:

The primary advantage of passive liveness is user experience: the verification is invisible, requiring no cognitive load or deliberate action. This matters for accessibility (users with motor impairments) and for throughput (no waiting for the user to complete a challenge). The downside is that passive methods can be more susceptible to high-quality 3D attacks—silicone masks with realistic skin texture and embedded eye prosthetics can defeat texture analysis alone.

Active Liveness Detection

Active liveness requires the user to perform a specific action in response to a challenge. The system verifies both that the action occurred and that the biometric sample captured during the action matches the enrolled template.

Active liveness provides stronger guarantees against sophisticated attacks at the cost of user friction. The challenge duration (typically 2–5 seconds) adds latency to the authentication flow, and the cognitive requirement creates accessibility barriers. In practice, most production systems use passive liveness as the primary path and fall back to active challenges only when the passive confidence score is below threshold.

The Deepfake Challenge

The threat model for liveness detection shifted fundamentally with the advent of real-time deepfake generators. Traditional liveness—both passive and active—assumes the camera is trustworthy: that the video frames arriving at the analysis pipeline originate from a physical sensor observing a physical scene. Injection attacks violate this assumption entirely.

In a camera injection attack, the attacker installs a virtual camera driver that intercepts the camera API at the operating system level. The biometric application believes it is receiving frames from a physical camera, but the frames are actually generated by a deepfake model running in real time. The deepfake model takes a source video of the attacker and maps it onto a target identity, producing photorealistic face-swapped frames at 30+ fps. Because the frames never pass through a physical camera, all optical-level detection (moiré patterns, specular reflection, screen pixel grid) is bypassed.

Modern injection attacks can also respond to active liveness challenges. If the deepfake model operates at sufficient frame rate, it can render the target identity performing blinks, head turns, and even speech—all driven by the attacker’s own movements in real time. This renders naive active liveness ineffective.

Defending against injection attacks requires moving detection upstream, to the sensor level:

Key Insight

The camera injection threat means that liveness detection cannot operate solely at the application layer. Sensor-level attestation (hardware-signed frames) and out-of-band signals (depth maps, IR reflectance) are now mandatory for high-assurance deployments. Any system relying exclusively on RGB frame analysis is vulnerable to real-time deepfake injection regardless of how sophisticated its passive or active liveness algorithms are.

FHE-Encrypted Liveness Verification

Traditional liveness detection has a fundamental privacy problem: the verification server must see raw biometric frames to analyze them. This means that every liveness check creates a window where unencrypted facial images exist on a server—a high-value target for attackers and a compliance liability under GDPR, BIPA, and similar biometric privacy regulations.

H33 eliminates this window by performing liveness verification on encrypted data. The approach works because liveness signals—texture features, temporal motion vectors, depth map statistics, IR reflectance ratios—can be encoded as numerical feature vectors and embedded into the same BFV ciphertext that carries the biometric template for identity matching.

The pipeline operates as follows: On the client device, the SDK extracts both identity features (face embedding, 128 dimensions) and liveness features (texture scores, motion vectors, depth statistics—additional dimensions packed into the same SIMD slots) from the captured frames. These features are encrypted locally using the BFV scheme (N=4096 polynomial degree, single 56-bit modulus, plaintext modulus t=65537) before leaving the device. The raw frames are discarded on the client and never transmitted.

On the server, H33 performs the biometric comparison and liveness verification simultaneously via homomorphic inner product computation. The BFV SIMD slot packing batches 32 users into a single ciphertext (4096 slots ÷ 128 biometric dimensions), and each user’s slot region includes the liveness feature components alongside the identity features. The entire batch—identity matching plus liveness verification—executes in approximately 1,109µs for 32 users, yielding ~42µs per authentication. At sustained production load on Graviton4 hardware (192 vCPUs), this pipeline achieves 2.17M authentications per second.

Encrypted Liveness Pipeline Performance

FHE Batch (32 users): ~1,109µs (BFV inner product, includes liveness signals)
ZKP Lookup: 0.085µs (in-process DashMap cache hit)
Attestation: ~244µs (SHA3 + Dilithium sign+verify, 1 per batch)
Total per auth: ~42µs
Sustained throughput: 2.17M auth/sec

The critical property is that the server never decrypts the biometric data or the liveness features. The homomorphic inner product produces an encrypted match score that encodes both “is this the claimed identity?” and “was this captured from a live person?” in a single computation. The result is decrypted only on the authority node holding the secret key, and only the binary match/no-match decision is returned. Raw feature vectors, individual liveness scores, and biometric templates remain encrypted throughout.

Multi-Signal Fusion in Encrypted Feature Vectors

Effective liveness detection requires fusing multiple independent signals. In H33’s architecture, this fusion happens before encryption—on the client device—so that the server operates on a single unified feature vector without knowing which dimensions represent identity and which represent liveness.

The signals fused into the encrypted feature vector include:

BFV’s SIMD batching is key to making this efficient. The 4096 polynomial slots are partitioned across 32 users, giving each user 128 slots. Of these, a typical configuration allocates 96 slots to the face identity embedding and 32 slots to liveness features. The homomorphic inner product computes a weighted dot product across all 128 dimensions simultaneously—identity matching and liveness verification are fused into a single FHE operation with no additional ciphertext cost.

This design means that adding more liveness signals does not increase per-authentication latency, as long as the total feature dimensionality stays within the 128-slot budget per user. Architects can trade identity embedding resolution for liveness signal breadth depending on the threat model: a high-security deployment facing sophisticated 3D mask attacks might allocate 64 dimensions to identity and 64 to multi-modal liveness, while a consumer mobile deployment might use 112 identity dimensions and 16 liveness dimensions.

Accuracy Metrics and Standards Compliance

Liveness detection performance is measured by two complementary error rates defined in ISO 30107-3:

MetricDefinitionTarget (High Security)Target (Consumer)
APCERAttack Presentation Classification Error Rate—the proportion of attack presentations incorrectly classified as bona fide<0.1%<1.0%
BPCERBona Fide Presentation Classification Error Rate—the proportion of genuine presentations incorrectly rejected as attacks<1.0%<3.0%

These two rates are in tension: lowering APCER (fewer successful attacks) tends to increase BPCER (more false rejections of genuine users). The operating point is chosen based on deployment context. Financial services and government identity programs typically operate at APCER < 0.1% even at the cost of higher BPCER, because the cost of a successful attack far exceeds the cost of asking a legitimate user to retry. Consumer applications tolerate higher APCER to minimize user friction.

ISO 30107-3 defines the testing methodology: PAI species (printed photos at various resolutions, screen replays at various sizes, 3D masks at various material qualities, partial face overlays) are enumerated, and APCER is reported per species. This per-species reporting is critical because a system might achieve <0.1% APCER against printed photos while failing at 15% APCER against high-quality silicone masks. Aggregate APCER alone is misleading.

In H33’s architecture, the liveness decision is part of the encrypted pipeline, so the match/no-match result inherits the post-quantum attestation chain. Every liveness verification result is signed with Dilithium (ML-DSA-65)—the same post-quantum signature scheme that attests to the identity match. This means the liveness result is non-repudiable and quantum-resistant: an attacker cannot forge a liveness attestation even with a quantum computer. The Dilithium signature is batched (one sign+verify per 32-user batch) to keep the attestation overhead at ~244µs per batch rather than per authentication.

Production Deployment Considerations

Deploying liveness detection at scale introduces engineering constraints that laboratory testing does not surface. The following considerations are drawn from production deployments of H33’s encrypted biometric pipeline.

Mobile SDK Requirements

The client-side SDK must access the camera at the hardware API level (AVCaptureSession on iOS, Camera2 on Android) rather than through high-level browser APIs (getUserMedia). Browser-based camera access is susceptible to virtual camera injection on desktop platforms and provides limited access to depth and IR sensors on mobile. The SDK performs feature extraction and encryption on-device, sending only the BFV ciphertext to the server. This requires approximately 50ms of client-side computation on modern mobile SoCs (A15+ on iOS, Snapdragon 8 Gen 2+ on Android) for feature extraction, encoding, and encryption.

Camera API and Sensor Access

Not all devices provide the full sensor suite. The SDK must degrade gracefully:

Network Latency Budget

H33’s server-side processing consumes ~42µs per authentication. In practice, the end-to-end latency is dominated by network round-trip time, not computation. A typical breakdown for a mobile deployment:

The server processing is negligible. Optimization effort should focus on reducing ciphertext payload size (currently ~32KB per authentication after SIMD batching) and ensuring edge deployment in regions close to the user population.

Graceful Degradation

When liveness confidence is ambiguous—the passive score falls in the gray zone between clear accept and clear reject—the system must not simply fail. Production deployments should implement a tiered response:

This tiered approach keeps the false rejection rate low for genuine users (most will pass on the first attempt with high confidence) while maintaining strong attack resistance for borderline cases. The active challenge fallback adds 2–3 seconds of latency but applies to fewer than 5% of genuine authentication attempts in well-lit indoor environments.

Key Insight

The strongest liveness detection architecture performs all signal fusion and verification on encrypted data. H33’s BFV pipeline processes identity matching and liveness verification in a single homomorphic inner product—the server never sees raw frames, raw features, or individual liveness scores. This eliminates the biometric data exposure window that makes conventional liveness systems attractive targets for both external attackers and insider threats.

Ready to Go Quantum-Secure?

Deploy encrypted biometric authentication with built-in liveness detection. Zero plaintext exposure.

Get Started

Build With Post-Quantum Security

Enterprise-grade FHE, ZKP, and post-quantum cryptography. One API call. Sub-millisecond latency.

Get Free API Key → Read the Docs
Free tier · 10,000 API calls/month · No credit card required
Verify It Yourself