Howto: Chat anonymously over the Tor Network with Torchat and Ubuntu!

This howto is for Gutsy or Hardy Heron. It shows you how to configure the onion router tor, and install the P2P client torchat. this client is written in python and runs on windows & MAC too!
TorChat is a peer to peer instant messenger with a completely decentralized design, built on top of Tor's location hidden services, giving you extremely strong anonymity while being very easy to use without the need to install or configure anything.

TorChat just runs from an USB drive on any Windows PC. (It can run on Linux and Mac too, in fact it was developed on Linux with cross platform usability in mind from the very first moment on, but the installation on other platforms than Windows is a bit more complicated at the moment)

Tor location hidden services basically means:



1. Install Tor & Privoxy
sudo apt-get install tor privoxy

2. Configure Privoxy
sudo gedit /etc/privoxy/config
add this line at the end: (with the dot at the end)
forward-socks4a / localhost:9050 .
Restart Privoxy:
sudo /etc/init.d/privoxy restart
Now go to Firefox addons and install this neat SwitchProxy Tool. After a FireFox restart, go to Extra > Switch Proxy > manage proxies > add > standard > next.

Enter the following information into both the HTTP Proxy and SSL Proxy fields.
Hostname: 127.0.0.1 Port: 8118.
Use SocksV5 and port 9050 for socks
Set up any proxy exceptions you may need (localhost, 127.0.0.1 is a good idea) and then click on OK.(Do this also for the proxy label)

3. Configure Tor:
sudo gedit /etc/tor/torrc
Find the following section and change it to:

############### This section is just for location-hidden services ###

## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 11009 127.0.0.1:11009

#HiddenServiceDir /var/lib/tor/other_hidden_service/
#HiddenServicePort 80 127.0.0.1:80
#HiddenServicePort 22 127.0.0.1:22

Now lets create the hidden tor dir & restart tor:
sudo mkdir /var/lib/tor/hidden_service/
sudo /etc/init.d/tor restart

4. Install Torchat
Now you can use firefox with tor. But we want chat, so get the latest Torchat source (at the time of writing this howto it was version 0.9.9.64)
mkdir ~/torchat
wget http://torchat.googlecode.com/files/torchat-source-0.9.9.64.zip
unzip torchat-source-0.9.9.64.zip
move source code:
(assuming the py files are unpacked in the folder /home/username/src)
sudo mv src/* ~/torchat/
Install needed python-wx:
sudo apt-get install python-wxgtk2.8 python2.5
Create starter menu entry:
sudo gedit /usr/share/applications/torchat.desktop
paste into the editor window:

[Desktop Entry]
Encoding=UTF-8
Name=torchat
Comment=anonymous chat client
Exec=python /usr/share/torchat/torchat.py
Icon=/usr/share/torchat/icons/torchat.ico
Terminal=0
Type=Application
Categories=Application;Internet;

5. get your user ID for torchat:
sudo less /var/lib/tor/hidden_service/hostname
This will display something like:
hanZcp5y3fljsnay.onion
The red part is your id, tell this ID (without the .onion) to your friends to add you to their torchat.
6. Tell Torchat your User ID:
sudo gedit ~/torchat/tc_client.py
Change OWN_HOSTNAME to your userid, or it will NOT work!
OWN_HOSTNAME = "hanZcp5y3fljsnay" #.onion ( <-- change the 16 Quoted chars with your onion ID... the red one from step 5)
7. Run Torchat:
Now start torchat with the Start menu Icon or from a terminal:
python ~/torchat/torchat.py

You will see a window with your contact list. One of the contacts is labled "myself". This 16 numbers and letters are your unique address inside the Tor-Network. Wait a few minutes until the icon becomes green. Give this address to your friends so that they can add you to their list or add your friends address to your list. It all basically behaves like you would expect from an instant messenger.

The Author states that starting TorChat & logging in the tor network can sometimes take up to 15 Minutes (it takes around 1 minute for me)

The contents of the folder /var/lib/tor/hidden_service are your personal key. They must always be kept secret. If someone wants to impersonate your identity he must and will try to steal the contents of this folder from you.

Keep this always in mind. It would probably be a good idea to use TorChat in conjunction with something like TrueCrypt.

8.Removing TorChat
If you have installed torchat following 4. (from source) run:
sudo rm /usr/share/applications/torchat.desktop
sudo rm -R ~/torchat/

In both cases, don't forget to safely delete the tor hidden_service directory /var/lib/tor/hidden_service/ with e.g. the shred tool!
Credits:
Bits & pieces for this howto were in true open source spirit shamelessly taken from:
- HOWTO surf anonymous by user dutch
- Torchat, written by prof7bit
- Truecrypt FAQ
- privoxy & tor manpages
- Installing SwitchProxy for Tor
- Ubuntu Forums

Clicky Web Analytics