Low Level Design: Device Fingerprinting Service

A device fingerprinting service identifies and tracks devices across sessions without relying on cookies or stored identifiers. It is a key signal for fraud detection, step-up authentication, and anomaly alerting.

Signal Collection

Fingerprints are built from browser and hardware signals collected client-side (via JavaScript) and server-side (from request headers). Common signals:

  • User agent string — browser, version, OS.
  • Screen resolution and color depth
  • Timezone and locale
  • Browser language list
  • Installed fonts — enumerated via canvas text measurement.
  • Canvas fingerprint — render a fixed scene; GPU and driver differences produce unique pixel outputs.
  • WebGL renderer and vendor string
  • Audio fingerprint — process an oscillator through the audio stack; subtle numeric differences per device.
  • Hardware concurrency — logical CPU count.
  • Touch points and pointer type

Fingerprint Construction

Not all signals are equally stable. Construct two hashes:

  • Stable fingerprint — hash of signals unlikely to change: canvas, WebGL, audio, hardware concurrency, screen resolution, font list. This is the primary device identity.
  • Unstable fingerprint — hash of signals that change often: user agent version, language list, timezone. Used as a secondary match signal.

Hashing: SHA-256 over a canonical JSON serialization of the signal map. Store both hashes in the device profile.

Stability Scoring

Each signal gets a weight based on empirical stability. A signal that changes on every browser update (e.g., user agent minor version) gets a low weight. A signal that changes only when hardware changes (e.g., canvas fingerprint) gets a high weight. The composite stability score is the weighted average of per-signal stability. Use this score to decide how much to trust a fingerprint match.

Fuzzy Matching

Fingerprints drift over time — a browser update changes the user agent, a system update shifts the canvas output slightly. Exact hash matching misses these. Use fuzzy matching to detect the same device despite partial changes:

  • SimHash — locality-sensitive hash that maps similar signal vectors to similar bit strings. Hamming distance below a threshold = same device candidate.
  • Jaccard similarity — treat signals as a set; measure set overlap between two fingerprints. Useful when signals are present/absent rather than numeric.
  • Match threshold tuned empirically. Too low = false positives (different devices treated as same). Too high = false negatives (same device not recognized).

Device Profile Storage

Each unique device gets a profile row in the DB:

device_profiles
  id                BIGINT PK
  stable_hash       CHAR(64)
  unstable_hash     CHAR(64)
  user_id           BIGINT NULL      -- linked after login
  first_seen_at     TIMESTAMP
  last_seen_at      TIMESTAMP
  signal_snapshot   JSON
  stability_score   FLOAT
  risk_score        FLOAT

Risk Signal Integration

The fingerprint service feeds into the broader risk engine. Key risk signals:

  • New device — first time this fingerprint has been seen for this user. Trigger step-up auth or notification.
  • Mismatched geo — fingerprint seen in a new country that does not match the user profile or IP geolocation history.
  • Fingerprint cluster associated with fraud — if many accounts share a fingerprint (headless browser, VM farm), flag the cluster. One fraudster using the same machine across accounts leaves a cluster signature.
  • Rapid fingerprint switching — legitimate users do not switch devices multiple times per hour.

Privacy Compliance

Device fingerprinting intersects with GDPR, ePrivacy, and CCPA. Design constraints:

  • Limit fingerprinting to legitimate security purposes (fraud detection, bot detection). Do not use for ad targeting without consent.
  • Disclose fingerprinting in privacy policy.
  • Honor deletion requests — purge device profiles linked to a user on account deletion.
  • Do not store raw signal data longer than needed. The hashed fingerprint is sufficient for matching; the full signal snapshot can be purged after a retention window.

Cross-Device Linking Detection

When multiple devices share signals (same canvas fingerprint, same font list, same IP subnet), they may belong to the same physical person or the same fraud operation. Build a graph: devices as nodes, shared signals as edges. Community detection on this graph surfaces clusters. High-density clusters of anonymous devices logging in to different accounts is a strong fraud signal.

Frequently Asked Questions: Device Fingerprinting

What is device fingerprinting and how is it used in fraud detection?

Device fingerprinting is the process of collecting browser or device attributes from a client and combining them into a stable identifier (a fingerprint hash) that can recognize the same device across sessions, even without cookies or logins. In fraud detection it is used to: link multiple accounts to a single device (account takeover, synthetic identity fraud), detect when a known fraudulent device attempts to create a new account, flag impossible scenarios such as the same fingerprint appearing from two geographically distant IPs within minutes, and build a device reputation score — a device seen making many failed login attempts is treated as higher risk even on the first transaction from a new account. Fingerprinting is a passive signal layered with behavioral and network signals, not a standalone blocker.

What signals are used to build a device fingerprint?

Signals fall into several categories. Browser/OS signals: user-agent string, browser language, timezone offset, screen resolution and color depth, installed plugins, Do Not Track setting, platform. Rendering signals (highly discriminating): Canvas fingerprint (render a hidden canvas element and hash the pixel output — GPU and font rendering differ per device), WebGL renderer and vendor strings, CSS media query results. Audio signals: AudioContext fingerprint (process a silent audio buffer; small hardware differences produce distinct output). Network signals: IP address, IP geolocation, ASN, whether the IP is a VPN/proxy/Tor exit node. Device hardware signals (mobile): accelerometer/gyroscope calibration data, battery status API (deprecated in many browsers). All signals are combined with a weighted hash or fed into an ML model to produce a stable fingerprint ID and a confidence score.

How do you match a device fingerprint when some signals change?

No single signal is stable — browsers update, users change networks, OS upgrades alter rendering. Use fuzzy matching: store each device’s fingerprint as a feature vector and compute similarity at match time rather than requiring exact hash equality. Approaches: (1) Weighted Jaccard similarity — weight stable signals (canvas, WebGL) more heavily than unstable ones (IP, resolution). Set a similarity threshold (e.g., 0.85) above which two fingerprints are considered the same device. (2) Locality-Sensitive Hashing (LSH) — hash the feature vector into buckets so candidate matches can be retrieved efficiently without scanning all stored fingerprints. (3) Stable sub-fingerprint — extract the most stable subset of signals into a “core fingerprint” used as an index key, then do full similarity comparison only within that bucket. (4) Supplement with a persistent first-party cookie or local storage token as a high-confidence signal when available, treating the fuzzy fingerprint as a fallback for cookieless environments.

How do you balance device fingerprinting effectiveness with user privacy?

Key tensions: fingerprinting is inherently covert (users can’t easily clear it like cookies), and regulations like GDPR and CCPA require lawful basis for processing device data. Balancing strategies: (1) Minimize signal collection — collect only the signals needed for the fraud use case; don’t build a full marketing-grade fingerprint for auth purposes. (2) Hashing and anonymization — store only a hash of the fingerprint, not the raw signals, so the data can’t be reversed to identify a person. (3) Consent and disclosure — disclose fingerprinting in your privacy policy; in high-regulation markets, obtain explicit consent or rely on legitimate interest with a documented balancing test. (4) Retention limits — expire fingerprint records after a defined period (e.g., 90 days of inactivity). (5) Avoid cross-site tracking — limit fingerprint sharing to your own services; don’t sell or share device IDs to third-party data brokers. (6) User controls — provide a way for users to report and reset their device association if they believe it’s incorrect.

See also: Stripe Interview Guide 2026: Process, Bug Bash Round, and Payment Systems

See also: Netflix Interview Guide 2026: Streaming Architecture, Recommendation Systems, and Engineering Excellence

See also: Scale AI Interview Guide 2026: Data Infrastructure, RLHF Pipelines, and ML Engineering

Scroll to Top