Part VI: Motion, Location, and Inertial Intelligence
Chapter 25: Localization, GNSS, and RF Positioning

Privacy and spoofing risks of location data

"A coordinate is a confession. I know where you sleep, where you pray, and which side street you take to avoid your ex. And a $30 radio can convince me you are somewhere you have never been."

An Omniscient AI Agent

The Big Picture

Every technique earlier in this chapter turned radio signals into a position estimate. This section studies what happens when that estimate becomes a liability rather than an asset. Location data is uniquely dangerous on two fronts at once. It leaks: a trajectory is a near-unique biometric that resists anonymization and exposes home, work, health, and belief. It lies: the civilian GNSS signals your device trusts are unauthenticated and roughly \(10^{16}\) times weaker than a terrestrial transmitter, so an adversary can overwrite them with a spoofed reality. A system that reads position without guarding both risks becomes a surveillance tool that also believes lies. You need the ideas here whether you are shipping a fitness tracker, an autonomous vehicle, or a drone.

This section assumes you understand how a position fix is formed from pseudoranges (Section 25.1), how RF fingerprints identify a location (Sections 25.2 and 25.3), and how inertial dead reckoning gives an independent motion estimate (Chapter 24), plus the leakage-safe dataset discipline of Chapter 5 and the probability primer of Chapter 4. We advance the deploy verb here: making localization trustworthy enough to ship.

Why a trajectory is a biometric, not a data point

What is the privacy problem? People assume that stripping names from a location log makes it anonymous. It does not. A trajectory has enormous entropy. The classic result from de Montjoye and colleagues showed that in a de-identified dataset of 1.5 million people, four approximate spatiotemporal points were enough to uniquely single out 95% of individuals. Two points still isolated more than half. Human mobility is that idiosyncratic.

Why does this happen? Two points dominate the identification: the most-visited nighttime cluster (almost always a home) and the most-visited daytime cluster (usually a workplace). The home-work pair alone is close to a fingerprint. Formally, the re-identification risk of a released trajectory set scales with the number of quasi-identifier points \(p\) an attacker holds. Empirically the fraction of uniquely identifiable users \(u\) rises steeply with resolution and with \(p\):

$$u(p) \approx 1 - (1 - \varepsilon)^{\,\alpha p}$$

where \(\varepsilon\) captures spatial-temporal resolution and \(\alpha\) the population sparsity. Coarsening the grid lowers \(\varepsilon\), which is why aggregation helps, but only slowly: uniqueness decays as a power law of resolution, so you must throw away a lot of precision to buy a little privacy.

How is this exploited in practice? Data brokers buy raw ad-SDK location feeds and join them against public voter files or property records at the home cluster to resell named movement histories, turning a visit to a clinic, a place of worship, or a protest into an inferable attribute. This is the biometric-privacy thread that runs through the whole book (see Chapter 34); location is arguably the most re-identifiable modality of all, because it is continuous and self-labeling.

Key Insight

Anonymization of location data is not a checkbox you apply at export; it is a property you must prove against an attacker model. "We removed the user ID" defends against nothing when the trajectory itself is the identifier. Design for the assumption that any raw coordinate stream you store or transmit can and will be re-linked to a named person.

Defenses that actually change the risk

Three families of defense move the needle, in increasing strength. Spatial cloaking and \(k\)-anonymity report a region containing at least \(k\) users rather than a single point, so no individual release can be traced to fewer than \(k\) possible people at that instant. It fails because the guarantee is per-query, not per-user: an attacker who links successive cloaked regions along a route, or who already holds the home-work cluster identified above, intersects enough regions to collapse the anonymity set back to one person. It stays cheap enough to implement (round the coordinates, or query a bounding box from a location server) that it still ships in low-stakes contexts such as weather-by-location APIs, but it is the wrong tool wherever an attacker can observe more than one fix from the same device. On-device processing keeps the raw trajectory on the phone and emits only derived, non-invertible features (step count, geofence-crossing events), which is the federated-learning philosophy of Chapter 64. Differential privacy (DP) gives a provable guarantee: a mechanism \(M\) is \(\epsilon\)-differentially private if for adjacent datasets \(D, D'\) and any output \(S\),

$$\Pr[M(D) \in S] \le e^{\epsilon}\,\Pr[M(D') \in S].$$

Geo-indistinguishability adapts DP to space by adding planar Laplace noise scaled to a privacy budget per query, making nearby locations statistically indistinguishable within a radius you choose; Apple and Google both deploy DP-style perturbation for aggregate mobility statistics. The engineering catch is the privacy-utility curve: a navigation app cannot tolerate kilometers of noise, so DP fits aggregate analytics far better than real-time routing.

Research Frontier: Trajectory-Level Synthetic Mobility Data

Point-wise differential privacy caps what any single location reveals, but a trajectory is correlated across time, so perturbing each point independently can still leave the route, and the identity behind it, recoverable by smoothing the noise back out. An active line of work trains transformer- and diffusion-based generators to emit entirely synthetic mobility datasets that match real aggregate statistics (flow volumes, visit-time distributions) under a trajectory-level privacy guarantee instead of a point-level one. The open problem is proving that guarantee without giving up the utility that urban planners and epidemiologists need from the released data.

Practical Example: the fitness heatmap that mapped a war zone

In 2018 a consumer wearable company published a global heatmap of aggregated running and cycling routes: no names, billions of points, just glowing lines of popular paths. In remote regions, though, the only people wearing GPS watches were foreign soldiers, so the heatmap traced the perimeter, internal roads, and jogging loops of otherwise-secret military bases. Aggregation had not destroyed the signal; it had concentrated it. The lesson for any sensory-AI product: privacy risk is contextual and adversarial, and a defense that works for a dense city can fail catastrophically for a sparse subpopulation. A minimum-count threshold suppressing low-density cells was the missing control.

Spoofing and jamming: when the signal itself lies

What is the integrity problem? Civilian GPS (the L1 C/A code) is public, unencrypted, and unauthenticated: a receiver believes any signal that correlates with the known code and yields a consistent navigation solution. Two attacks follow. Jamming raises the noise floor with broadband RF so the receiver loses lock, an obvious denial of service because the fix disappears. Spoofing is worse: the attacker transmits counterfeit satellite signals, slightly stronger than the real ones, and walks the victim's solution smoothly away from the truth. Done well, the receiver never reports an error; it reports a confident, wrong position.

Why is it feasible? GPS signal power at ground level is around \(-160\ \text{dBW}\), weaker than the thermal noise floor, so a software-defined radio a few hundred meters away can dominate it by tens of decibels using milliwatts. Open-source spoofing stacks and sub-$300 hardware have made this a hobbyist-grade attack, which is why it has graduated from research curiosity to routine hazard for maritime and aviation traffic near contested regions.

Misconception: High Reported Accuracy Means the Fix Is Trustworthy

A receiver's accuracy estimate or HDOP (horizontal dilution of precision) describes the geometry of the satellites it is using, not whether those satellites are real. A competent spoofer transmits a clean, internally consistent constellation, so the victim receiver reports excellent accuracy right up through the moment it is being lied to. Treat on-receiver confidence metrics as a measure of internal consistency, not of ground truth; only an independent sensor or an authenticated signal can confirm the position is real.

How do you defend at the algorithm level? You never trust GNSS alone. The defenses form layers, and most are cheap consistency checks a model can run:

Right Tool: consistency checks you do not hand-roll in production

The innovation-gating spoof detector below is about 20 lines of NumPy for teaching. In a shipped estimator you fold the same test into a robust filter: filterpy exposes the Kalman innovation and its covariance directly, so a Mahalanobis gate plus a chi-squared threshold is roughly 3 lines instead of 20, and it inherits the tuned process and measurement noise you already maintain. The library handles the covariance bookkeeping, the numerically stable inverse, and the per-update residual you would otherwise recompute by hand.

The snippet below implements the physical-consistency idea directly: it flags a GNSS fix whenever the implied jump from the last inertial-propagated position exceeds what the platform's dynamics allow, expressed as a Mahalanobis distance against the fused uncertainty.

import numpy as np

def spoof_gate(gnss_xy, pred_xy, cov, chi2_thresh=13.8):
    """Flag a GNSS fix inconsistent with the inertial-predicted state.
    gnss_xy, pred_xy: 2D positions (m). cov: 2x2 predicted-position
    covariance (m^2). chi2_thresh: 0.999 quantile of chi-square, df=2.
    Returns (is_spoof, mahalanobis_d2)."""
    innov = np.asarray(gnss_xy) - np.asarray(pred_xy)      # residual
    d2 = float(innov @ np.linalg.solve(cov, innov))        # Mahalanobis^2
    return d2 > chi2_thresh, d2

# Honest fix: within 1 sigma of the dead-reckoned prediction
pred = np.array([100.0, 50.0])
P = np.array([[9.0, 0.0], [0.0, 9.0]])          # 3 m std each axis
print(spoof_gate(pred + [2.5, -1.0], pred, P))  # (False, ~0.9)

# Spoofed fix: a smooth 40 m pull the dynamics cannot explain
print(spoof_gate(pred + [40.0, 0.0], pred, P))  # (True, ~177)
A minimal innovation-gate spoof detector. It compares each GNSS fix against an inertial prediction and rejects fixes whose Mahalanobis distance exceeds the 0.999 chi-square quantile for two degrees of freedom, catching the "impossible jump" signature of a spoofer while tolerating honest noise.

Notice the tuning tension echoed from Section 25.6: too tight a threshold rejects honest fixes during real dynamics; too loose lets a slow "walk-off" spoof through under the gate. The right threshold is a per-platform decision informed by the dynamics model, not a universal constant, which is why calibrated uncertainty (Chapter 18) matters as much here as it does for any learned model.

Key Insight

Jamming attacks your availability; spoofing attacks your integrity. Availability failures announce themselves (the fix vanishes). Integrity failures are silent by design: a confident wrong number is more dangerous than a missing one. Every localization system that can affect the physical world must therefore carry an independent check that answers "should I believe this position at all?" before it answers "where am I?"

Threat modeling location for a real product

When do you invest in which defense? Match the control to the consequence. A step counter that never leaves the wrist needs on-device processing and minimum-count aggregation, and can ignore spoofing entirely. A ride-hailing backend storing millions of trajectories needs DP for its analytics exports and strict retention limits, because its dominant risk is the biometric-leak class, not the RF-attack class. An autonomous vehicle or a delivery drone inverts the priority: a spoofed position can drive it into traffic, so multi-sensor consistency gating, signal authentication where available, and a safe-stop fallback are non-negotiable, while the privacy of its own pose matters less. Write the attacker down first (who, what capability, what payoff), then pick defenses; a control chosen without a threat model is theater.

Exercise

Take a public taxi-trajectory dataset (for example the Porto or NYC taxi logs). (1) Keep only the first and last GPS point of each trip and measure what fraction of trips become uniquely identifiable by that pair alone; compare against using two random interior points. (2) Snap all points to a 500 m grid and re-measure. Plot the uniqueness-versus-grid-size curve and estimate the resolution needed to push uniqueness below 10%. (3) Simulate a walk-off spoof by adding a linearly growing offset to one trip's coordinates, then tune the chi2_thresh in the snippet so your gate catches it before the offset exceeds 25 m without firing on honest GPS noise.

Self-Check

1. Why does removing user IDs from a location dataset fail to anonymize it, and which two clustered points carry most of the re-identification power?

2. Distinguish jamming from spoofing in terms of which security property each attacks and which one a receiver can detect more easily on its own.

3. A colleague proposes protecting a turn-by-turn navigation app with differential privacy by adding 500 m of planar Laplace noise to every fix. Why is this the wrong defense for that product, and what would you use instead?

Lab 25

fuse GNSS and inertial readings for a smoother, drift-corrected trajectory.

Bibliography

Location privacy and re-identification

de Montjoye, Y.-A., Hidalgo, C. A., Verleysen, M., and Blondel, V. D. (2013). Unique in the Crowd: The privacy bounds of human mobility. Scientific Reports.

The landmark result that four spatiotemporal points re-identify 95% of individuals; the quantitative backbone of the "trajectory is a biometric" argument.

Andres, M. E., Bordenabe, N. E., Chatzikokolakis, K., and Palamidessi, C. (2013). Geo-indistinguishability: Differential privacy for location-based systems. ACM CCS.

Adapts differential privacy to geographic space with the planar Laplace mechanism; the formal basis for provable location perturbation.

Gruteser, M. and Grunwald, D. (2003). Anonymous Usage of Location-Based Services Through Spatial and Temporal Cloaking. ACM MobiSys.

Introduced spatial-temporal cloaking and location k-anonymity; the baseline defense whose limits motivate stronger guarantees.

GNSS spoofing, jamming, and authentication

Humphreys, T. E., et al. (2008). Assessing the Spoofing Threat: Development of a Portable GPS Civilian Spoofer. ION GNSS.

The foundational demonstration of a practical portable civilian-GPS spoofer; defined the walk-off attack this section defends against.

Psiaki, M. L. and Humphreys, T. E. (2016). GNSS Spoofing and Detection. Proceedings of the IEEE.

Comprehensive survey of spoofing mechanisms and detection strategies, including C/N0, angle-of-arrival, and consistency-based methods.

European Union Agency for the Space Programme (2023). Galileo Open Service Navigation Message Authentication (OSNMA) Signal-in-Space ICD.

The deployed cryptographic navigation-message authentication scheme; the reference for signal-level anti-spoofing at constellation scale.

Regulation and reference software

European Parliament (2016). General Data Protection Regulation (GDPR), Regulation (EU) 2016/679.

Establishes location data as personal data with purpose-limitation and minimization duties; the legal frame every location product ships under.

Labbe, R. (2018). FilterPy: Kalman and Bayesian Filters in Python.

Reference filtering library exposing the innovation and its covariance, turning the spoof-gate of this section into a few maintained lines.

What's Next

In Chapter 26, we shift from where a person is to what they are doing. Human activity and behavior recognition turns the same inertial and location streams into labels like walking, cycling, or falling, and it inherits every privacy lesson from this section: a rich activity trace is as re-identifying as a trajectory, and the models that read it must be as robust to spoofed inputs as they are accurate on honest ones.