Should the Whonix website default to using cryptolog? What about qubes-os.org?
Cryptolog is a simple log filter program that reads log file entries from standard input and writes to either a file or pipes them to the standard input of another program (like logrotate or cronolog). The filter takes the IP address in the entry (everything before the first space character) and encrypts it, throwing away the key.
Technically, cryptolog takes 16 bytes of random data from /dev/urandom and stores it in a file (called the salt). It then calculates a sha256 hash of the salt concatonated with the original IP address, base64-encodes that, and chops off the first six characters of the result. That’s what gets stored instead of the IP address in the resulting log entry. Of course this means that if someone who wishes to know the original IP addresses gets access to these logs, all they need to know is the salt (which is also stored on the hard drive) to uncover the original IPs. In order to prevent this, the salt gets updated once a day with a new random 16 bytes. At worst, an attacker can only get the last day’s worth of original IP addresses.
Cryptolog makes logs that look like this:
184.108.40.206 - - [12/May/2011:17:58:07 -0700] “GET / HTTP/1.1” 200 430
Look like this instead:
UkezVh - - [12/May/2011:17:58:07 -0700] “GET / HTTP/1.1” 200 430
The string that replaces the IP address will remain the same for the same day, so you can tell the difference between unique visitors and pageviews.
Here are some example CustomLog lines for your Apache config files:
CustomLog “| /usr/bin/cryptolog -w /root/cryptolog-access.log” combined
CustomLog “| /usr/bin/cryptolog -c /usr/bin/cronolog\\ /root/cryptolog-access-%Y-%m-%d.log” combined
CustomLog “| /usr/bin/cryptolog -s /tmp/salt_file -w /root/cryptolog-access.log” combined
Notice that if you’re using the -c option, you need to escape spaces in the command you’re running with three backslashes.
On a related issue, is there a reason the Whonix forums can’t be used/run under the .onion domain (unlike the wiki)?
Assume in advance everyone and everything posted here is of great interest to the police state authoritarians.