Skip to content

Lesson 4 of 13 · 12m

Pseudonymized Is Not Anonymous

Hashing enumerable identifiers is reversible encoding; keyed MACs buy isolation but the data stays personal under GDPR.

173 million taxi rides

In June 2014, New York's Taxi & Limousine Commission responded to a FOIL request by publishing 173 million taxi trips — pick-up and drop-off times, GPS coordinates, fares — with medallion numbers and hack-license numbers "anonymized" via MD5. Vijay Pandurangan enumerated the medallion space (the format is constrained: one digit, one letter, two digits) and reversed every hash in about two hours. Anyone could now join the trips to drivers — and, with a little auxiliary data, to the celebrities whose rides paparazzi photos already timestamped.

The TLC had done what most teams do: taken a structured identifier, hashed it, and declared victory. The identifier's domain was enumerable, so the hash was a reversible encoding.

Why hashing identifiers fails

A hash is a deterministic map. Its protection is exactly as strong as the size of the domain it maps from. Phone numbers are roughly 10^10 candidates; US dates of birth about 36,000; SSNs 10^9; postal codes tens of thousands. A laptop computes SHA-256 over every US-format phone number in minutes. If the input domain is enumerable, the hash is a lookup table waiting for enumeration.

Salting doesn't save it. Salts defeat precomputed multi-target rainbow tables; they do nothing against a single-domain dictionary, because the attacker just recomputes the dictionary with the salt. SHA256(salt || "+1555…") is brute-forced at exactly the same speed.

GDPR knew this in 2016. Article 4(5) defines pseudonymization as processing where data can no longer be attributed to a specific subject without additional information kept separately — and explicitly classifies the result as still personal data. Recital 26 sets the bar for true anonymization, and the Article 29 Working Party's Opinion 05/2014 on anonymisation techniques calls out raw hashing of low-entropy attributes as a failure case. Pseudonymized data is personal data. Full GDPR applies.

When hashing is the product

Facebook Custom Audiences asks you to upload hashed emails and phone numbers so Meta can match your customers for ad targeting. The hashing there isn't privacy — it's a matching protocol. Meta holds the plaintext population, so every hash resolves immediately. When Kashmir Hill's reporting confirmed in September 2018 that Facebook also used phone numbers people provided for two-factor auth for ad targeting, the mechanism was the same: hashes of enumerable domains are identifiers, not protections.

Avast's Jumpshot subsidiary sold "anonymized" browsing histories with a DeviceID column that buyers could link back to individuals. The FTC banned the sale of browsing data and fined Avast $16.5 million in February 2024. "Anonymized" with a persistent identifier is a marketing adjective, not a property of the data.

Pseudonymization done right

The working primitive is the keyed MAC: HMAC-SHA256(user_id, key) where the key lives in a KMS, rotates, and is access-controlled separately from the data. Now the linkage token:

  • cannot be reversed by dictionary (the attacker needs the key, not the domain),
  • can be destroyed to sever linkage — destroy the key, every token goes dead,
  • rotates on compromise without touching the data.
token = hmac.new(kms_key, user_id.encode(), hashlib.sha256).hexdigest()

Treat the token table as personal data — it is. Pseudonymization buys you isolation and revocability; it does not buy you an exemption.

The practice

  • Never export hashed identifiers and call the dataset anonymous. If a hash was derived from an enumerable attribute, it's an identifier.
  • Pseudonymize join keys with keyed MACs under managed keys; keep the key service separate and audited.
  • In DPIAs and vendor reviews, reject "we anonymize via hashing" as a claim. Ask what the domain is and who holds the dictionary.

Pseudonymization is access control architecture. Anonymization is a property you must prove. They are not the same word.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.