The daily salt: how deleting a key turns pseudonymous data anonymous
· 4-minute read · Measurement and growth · by Direct Softworks
Hashing an IP address does not anonymise it. There are only four billion of them and a laptop can try all of them. What changes the answer is destroying the key.

"We hash the IP address, so it is anonymous."
This appears in privacy policies constantly and it is false, in a way that is easy to demonstrate and consequential to get wrong.
Why a hash of an IP is not anonymous
A hash is one-way in the sense that you cannot invert the function. It is not one-way in any sense that matters when the set of possible inputs is small enough to try them all.
IPv4 has about 4.3 billion addresses. A commodity machine computes SHA-256 at hundreds of millions of hashes per second. So building a complete table of every IPv4 address and its hash takes seconds, not centuries. Add a user agent string and the space grows, but the realistic space of user agents is small, and you are still in the region of trivially computable.
Which means: given a hashed identifier and the algorithm, anybody can recover the IP address. The hash has changed the storage format and not the nature of the data.
Under GDPR, that makes it pseudonymous. Still personal data, still in scope, still subject to access and erasure requests. The regulation is explicit that data which can be attributed to a person by the use of additional information is personal data, and "the additional information" here is a lookup table anybody can build.
What a salt changes, and what it does not
Add a secret salt and the table cannot be precomputed by an outsider. That is a real improvement against an attacker who steals your database and nothing else.
But it does not help against you. You hold the salt. You can rebuild the mapping whenever you like, which means you are still processing personal data, and correctly so, because you retain the means of attribution.
A fixed salt gets you security, not anonymity. Those are different properties and they are routinely conflated.
The bit that actually works
Rotate the salt every day. Then delete the old one.
Once yesterday's salt is gone, yesterday's identifiers cannot be linked to an IP address by anybody, including you, including under legal compulsion, because the means of attribution no longer exists anywhere. That is not a policy commitment. It is an arithmetic fact about what is recoverable.
The trade is exactly what you would expect: within a day, the identifier is stable, so a session holds together and you can sequence pages. Across days, it is not, so you cannot tell that Tuesday's visitor and Thursday's visitor were the same person.
You are trading cross-day identity for the ability to measure everybody. For a business website that is a good trade, because the cross-day question is the less useful one and it is available anyway for visitors who consent to a stored identifier.
The implementation details that matter
Delete, do not archive. The obvious failure is a backup. If yesterday's salt is in a nightly database dump kept for a year, you have not deleted it, and the guarantee is void. The salt table has to be excluded from backups, or the backups have to expire faster than the claim you are making.
Two days, not one. Keep today's and yesterday's, so a session crossing midnight does not break. Then delete. The boundary is where implementations quietly leak: a sloppy version keeps a rolling window that never actually drops anything.
Do not derive the salt from something reproducible. A salt computed from the date is not a secret. It has to be random and stored, which is what makes deleting it meaningful.
Say it in the privacy policy, specifically. "We use anonymised analytics" is not a claim anyone can evaluate. "We hash IP and user agent under a daily salt which is deleted after two days, so visits cannot be linked across days" is checkable, and it is the kind of statement that makes the rest of your policy more credible rather than less.
Where this pattern applies beyond analytics
Anywhere you need to count distinct things without knowing which things they are.
Rate limiting by IP without retaining IPs. Fraud signals that flag repetition within a window. Deduplicating survey responses. Counting unique readers. Each of these needs identity for a short period and does not need it afterwards, and each is routinely implemented by storing the raw identifier forever because that is the path of least resistance.
The general shape is worth stealing: decide how long you need to be able to tell two things apart, and destroy the ability to do so at the end of that period. Retention policies usually delete records. This deletes a capability, which is stronger, because it also covers the records you forgot you had.
It is the same instinct as not keeping an audit log forever, and the same one behind measuring the visitors who decline as well as the ones who accept. Privacy engineering that actually works is mostly about arranging to not have things.