On Monday, some IP address xxx.xxx.xxx.xxx visits my site. I log it.
On Tuesday, another IP address yyy.yyy.yyy.yyy visits my site. I log it.
If the two IP addresses are equal, I throw out the second one because I'm only interested in unique visits to my site. If they are not the same, I keep both in my log.
Question: Is it possible to do this without ever logging the IP addresses themselves, by using some kind of hashing/encryption, in such a manner that it is not possible to deduce the IP addresses from the hashed/encrypted data?
At first glance, it seems to me that this would be impossible, because you can always brute force all the possible IP addresses into whatever hash/encryption scheme you're using, until it matches your hashed/encrypted data - and thus deducing the original IP address.
But I hope I'm missing something. Maybe it's possible to bring time into this to make this achievable somehow?
I'm not knowledgeable enough in security to know the possibility or impossibility of this. Any advice would be appreciated.
Additional information: I'd like to store as much information as possible (without, of course, being able to deduce the original IP addresses). For instance, I may not necessarily want to store merely the all-time total of unique visitors. Instead, I may want to know the total unique visitors during a particular day, week, or a month. So actually storing all of the encrypted/hashed IP addresses would be important. So, in this sense, I was wrong when I talked above about "throwing out the second one".
Note: I'm looking for some scheme under which nobody, not even me, can deduce the IP address. Some solutions have been provided that are such that I can myself technically deduce the original IP address, but I don't even want ability to do so myself. This sounds impossible, but who knows. Maybe some trickery exists out there for achieving what I want?