I'd like to find a way to anonymize IP addresses in web logs to ensure user privacy given the following requirements:
- If given an IP address, there is no way to look up which requests came from the IP address.
- Given the set of requests, it can be determined which requests came from the same IP address.
This way no one (including an attacker) can determine the original IP addresses from the log. An attacker (anyone with access to the log) would be able to determine which IPs are distinct, though.
I'm envisioning something like the this. Each request is sent through a function that creates a unique identifier for each IP address (notice that request 1 and 4 are from the same IP address, but result in different hashes).
- Request 1 - 192.168.0.1 => EIDKSJD
- Request 2 - 192.168.0.2 => GIEKDJS
- Request 3 - 192.168.0.3 => CIDJSDJ
- Request 4 - 192.168.0.1 => DJCUDJS
But there is another function that takes two outputs and determines if they came from the same IP.
- same_parent(EIDKSJD, GIEKDJS) returns false
- same_parent(EIDKSJD, DJCUDJS) returns true
This method has it's downsides, specifically that searching for duplicates is not efficient. If there's a method that is efficient for searching and meets criteria 1 and 2 above, I would up-vote twice if I could :).