Open Source / MIT + Apache 2.0

Facelock

Face authentication for Linux. Windows Hello-style facial recognition with IR anti-spoofing, sub-second daemon-mode latency, and complete privacy -- all authentication runs locally on your hardware with no telemetry. After initial model download, Facelock never touches the network.

facelock
$ sudo facelock enroll
Detecting camera...
Found: Integrated IR Camera (/dev/video2)
Look at the camera. Capturing 5 frames...
Frame 1/5 detected (confidence: 0.97)
Frame 2/5 detected (confidence: 0.98)
Frame 3/5 detected (confidence: 0.96)
Frame 4/5 detected (confidence: 0.97)
Frame 5/5 detected (confidence: 0.98)
Enrolled face model "default" for user ty
 
$ sudo facelock test
Authenticating...
Match (similarity: 0.92, latency: 192ms)

Three-stage recognition pipeline

SCRFD detection finds faces, affine alignment normalizes geometry, and ArcFace produces a 512-dimensional embedding for cosine similarity matching.

Camera Capture

V4L2 frame acquisition with auto-detection. Prefers IR cameras for anti-spoofing. CLAHE enhancement for consistent lighting.

Face Detection

SCRFD neural network locates faces and extracts 5-point landmarks. Affine alignment produces a normalized 112x112 crop.

Embedding Match

ArcFace produces a 512-dim L2-normalized vector. Cosine similarity against stored embeddings determines match or reject.

Built for security and performance

A complete face authentication stack written in Rust, designed for the Linux PAM ecosystem.

IR Anti-Spoofing

Enforces infrared cameras by default. Phone screens and printed photos lack IR skin texture, blocking the most common attack vector.

Sub-Second Auth

Persistent daemon keeps ONNX models loaded. ~600ms typical, dropping to ~150ms on back-to-back auths when the camera stays warm.

100% Local & Private

All processing happens on-device via ONNX Runtime. No cloud services, no network requests, no telemetry, no analytics. Your face data never leaves your machine, ever.

PAM Integration

Drop-in PAM module for sudo, polkit, and login. Installs as a single pam_facelock.so with one line in your PAM config.

TPM Encryption

Optional TPM 2.0 support for encrypting face embeddings at rest. Hardware-bound keys ensure biometric data stays protected.

Daemon + Oneshot

Choose persistent daemon mode for speed or oneshot mode for simplicity. The CLI auto-detects which mode is available.

Defense in depth

Multiple independent layers protect against spoofing, tampering, and unauthorized access.

IR

IR Camera Enforcement

Enabled by default. Rejects RGB cameras that are trivially spoofed with a printed photo. IR captures skin texture invisible to screens.

FV

Frame Variance

Requires micro-movement between consecutive frames. Static photos produce near-identical embeddings and are rejected automatically.

RL

Rate Limiting

5 attempts per user per 60 seconds by default. Prevents brute-force and rapid-retry attacks against the daemon.

MV

Model Verification

ONNX model files are SHA256-verified at every load. Tampered models are rejected before any inference runs.

DB

D-Bus Policy

D-Bus system bus policy restricts daemon access. Only root and facelock group members can send messages to the daemon interface.

AL

Audit Logging

Every authentication attempt is logged to syslog with user, service, and outcome. Full audit trail in journald or /var/log/auth.log.

Your face, your machine, nobody else

Facelock is designed from the ground up to keep your biometric data private.

LO

Local-Only Processing

Face detection and recognition run entirely on your CPU or GPU via ONNX Runtime. No images or embeddings are ever transmitted over the network.

NT

No Telemetry

Zero analytics, tracking, or phone-home code. Models are downloaded once during facelock setup -- after that, Facelock never contacts any server.

EN

Encryption at Rest

Face embeddings can be encrypted with AES-256-GCM, optionally sealed to your TPM. Even if someone copies your database, the biometric data is unreadable.

OS

Open Source & Auditable

Every line of code is MIT/Apache-2.0 licensed. No proprietary blobs, no obfuscated network calls. Verify the privacy claims yourself.

Up and running in minutes

Build from source, download models, enroll your face, and enable PAM authentication.

Arch Linux
terminal
# Build and install the package
$ cd dist && makepkg -si
 
# Download face detection models (~170MB)
$ sudo facelock setup
 
# Enroll your face
$ sudo facelock enroll
 
# Test recognition
$ sudo facelock test
 
# Enable daemon with D-Bus activation
$ sudo facelock setup --systemd
 
# Install PAM module for sudo
$ sudo facelock setup --pam

Also available as .deb, .rpm, and Nix flake. See docs for details.

Facelock vs Howdy

Facelock is a ground-up rewrite of the Howdy concept, built in Rust with security as a first-class concern.

Feature Facelock Howdy
Language Rust Python
Daemon mode Yes (~150-600ms auth) No (process per auth)
IR enforcement Default on Not enforced
Frame variance check Default on No
TPM encryption Optional No
Model verification SHA256 at every load No
Rate limiting 5/user/60s No
D-Bus activation D-Bus activation No
Constant-time matching subtle crate (no timing leaks) No
GPU acceleration CUDA / ROCm / OpenVINO (runtime) No
Audit logging Structured JSONL + syslog No
systemd hardening ProtectSystem, NoNewPrivileges, etc. No
PAM module size ~2MB (no heavy deps) Full Python runtime