Project Part 2 - Hidden Services implementation overview 
personal public git repository for JTor

Javadocs for hiddenservice package

As part of JTor, the Java Tor Protocol library, I have decided to take on a specific part of the Tor protocol, the hidden services. Say that someone wants to offer a service - web server, chat server, any kind of server/service - but they want their IP to remain anonymous. Tor hidden services allows this.

Because this is a Java library, my goal is to make my code easily usable for people who want to establish a hidden service connection. I will provide an interface for developers who want to incorporate Hidden Services into their program or for alternative Tor clients and protocols.

This problem can be split into two different parts - the Server(Bob) and the Client(Alice). Before this can happen, Bob needs to initialize the service.

  • Bob initializes the Hidden Service with a service name and a port range
  • A public/private key pair is generated for encryption via the hidden service.
  • descriptor-id = H(permanent-id | H(time-period | descriptor-cookie | replica)) - where H(x) is the SHA1 digest of x
  • Bob then establishes introduction points which are also encoded in the Service Descriptor
  • Service descriptor is sent to Tor directory service (advertised) - Bob keeps circuits open to introduction points and waits for connections

Now, the hidden service is available for Alice to connect to:

  • Alice obtains the onion address
  • Alice queries directory services for onion address (x).(y).z.onion
  • Alice obtains the address's ServiceDescriptor
  • Alice sets up rendezvous points to one or more of the advertised introduction points
  • Circuit is established: Alice sends requests to Bob and Bob responds.

Important Algorithms:

  • correct encryption and encoding
  • managing cmultiple circuit connections
  • time synchronization (time-period = (current-time + permanent-id-byte * 86400 / 256) / 86400)
  • maintaining & generating unique identifiers

For more information, please refer to Tor's Hidden Service Spec or my notes about Hidden Services.

[ add comment ] ( 18 views )   |  permalink

<<First <Back | 1 | 2 | 3 | Next> Last>>