Chapter 3. Privacy and Anonymity

It’s been said before, but it’s truer now than ever: the Internet can be a scary place. Performing banking transactions, filing taxes, paying bills, and buying and selling goods online—all of these things were unheard of in the early days of the Internet. However, as people and businesses have become increasingly savvy in the electronic world, so have the crooks that prey on them. In addition, the increased scrutiny of people’s online identities by governments, employers, and other organizations might make you think twice about what you say the next time you post on a public message board.

Because of this, it’s important to take precautions to safeguard your identity and take control of your information online. This chapter provides you with a few ways to do just that. In this chapter, you’ll learn how to protect your privacy and remain anonymous while using the Internet. You’ll also learn how to encrypt your files and email using strong encryption. Finally, you’ll learn how to guard against phishing attacks and how to easily use different passwords for each web site you use without struggling to keep track of them.

Use transparent onion routing to evade traffic analysis and protect your privacy.

Privacy is something most people value, or at least think they do, but in our ever-connected world it’s becoming quite a rare commodity. Every packet your computer sends out onto the Internet is ultimately traceable back to you (the Internet wouldn’t work properly if it weren’t), but that’s just the tip of the iceberg. Since all your traffic must flow through your ISP, it’s possible for them to build a complete picture of you from the web sites you visit.

One way to guard against traffic analysis is to use The Onion Router, Tor (http://tor.eff.org).

Now all that’s standing between you and a working Tor installation is the task of configuring Privoxy. To do this, add the following line at the beginning of the /usr/local/etc/privoxy/config file:

forward-socks4a / localhost:9050 .

This line tells Privoxy to forward all requests to a SOCKS4a proxy at 127.0.0.1:9050, which Tor has been configured to act as.

Privoxy will log all requests by default, so you’ll also want to disable logging. You can do this by locating and removing the following lines:

logfile logfile
jarfile jarfile

Now, start Privoxy and Tor:

# /usr/local/sbin/privoxy --user privoxy privoxy /usr/local/etc/privoxy/config
Apr 10 00:26:10 Privoxy(-1208432960) Info: loading configuration file '/usr/local/etc/privoxy/config':
Apr 14 00:26:10 Privoxy(-1208432960) Info: Privoxy version 3.0.3
Apr 10 00:26:10 Privoxy(-1208432960) Info: Program name: /usr/local/sbin/privoxy
Apr 10 00:26:10 Privoxy(-1208432960) Info: Listening on port 8118 for local connections only
# /usr/local/bin/tor --user tor --group tor --datadirectory /var/run/tor
Apr 10 00:27:50.023 [notice] Tor v0.1.1.18-rc. This is experimental software. Do not rely on it for strong anonymity.
Apr 10 00:27:50.024 [notice] Configuration file "/usr/local/etc/tor/torrc" not present, using reasonable defaults.
Apr 10 00:27:50.027 [notice] Initialized libevent version 1.1a using method epoll. Good.
Apr 10 00:27:50.027 [notice] connection_create_listener(): Opening Socks listener on 127.0.0.1:9050
Apr 10 00:27:56.626 [notice] We now have enough directory information to build circuits.
Apr 10 00:28:01.463 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.

You can now configure your web browser to use Privoxy as its HTTP proxy. When doing this, specify localhost as the hostname and port 8118. You can then test out your Tor setup by visiting the Tor test page (http://serifos.eecs.harvard.edu/cgi-bin/ipaddr.pl?tor=1). If you’re connecting to it through Tor, you should see something similar to Figure 3-1.

Tor can be used for much more than just anonymizing web browsing, though. You can tunnel SSH through Tor [Hack #38] and use Tor with IRC clients, IM, and anything else that supports SOCKS. However, keep in mind that Tor does not provide end-to-end encryption. Any unencrypted traffic sent through Tor will only be protected until it exits the Tor network.