11

I know that when sending data from the Tor client to a server it is encrypted and gradually get decrypted on the way there.

This question is about when the server responds. The data must be encrypted or the entry guard (who knows your location) can read it and work out exactly what you are doing.

My assumption is that the exit node encrypts the response, sends it to the middle.

Then I wonder if the middle node encrypts it more before sending to the entry node and then the entry node encrypts it more before it sends it to the Tor user to decrypt, or if it just sends it without encrypting any more (as more encryption is unnecessary).

I've been trying to find this in the documentation and have been unsuccessful so far.

puser
  • 510
  • 3
  • 14

1 Answers1

9

The circuit: [ Tor user <-> Guard node <-> Middle node <-> Exit node <-> Server ]

Sending data to server:

  1. The Tor client always encrypt the data for the exit node
  2. And then encrypts it again (another layer) for the middle node
  3. And then again (yet another layer) for the guard node

This way one layer need to be peeled of at each hop in the network. If end-to-end encryption the data is also encrypted for the server first, in yet another layer (HTTPS/TLS, not by Tor).

Recieving data from server:

  1. The exit node encrypts answer data for the Tor user
  2. Then the middle node encrypts it again for the Tor user
  3. Then the guard node adds yet another layer encryption for the Tor user
  4. Tor user decrypts all layers

The process is reversed in other words. Simplified, the nodes just "add back" the encryption they peeled of when sending back the answer. If this wasn't done there wouldn't be any purpose of using multiple hops, because it would be possible for an adversay running Tor nodes to track where the answer data travels.

Rhin
  • 806
  • 5
  • 10