1

I'm a bit confused by something regarding Tor. As per what I have read and confirmed in this answer Tor: Is a Diffie-Hellman key exchange being done over recipient of traffic? the client does a DH key exchange with each node in the relay.

This results in 3 shared secrets and the client encrypts the message 3 times with each different key.

To decrypt the node uses its shared DH key to peel off a layer.

Problem is that the node must know which DH shared secret to use as I assume there are many clients doing this and the node may have many of these. So in order to use the correct shared secret it needs to know which DH exchange this specific message is for and it can then know the sender.

What an I missing?

Thanks, Chris

1 Answer 1

3

The key exchange between a client and a relay is not done directly but is wrapped in the onion layers like any other communication: A connection ("stream") through the Tor network gets first build to the first relay, then through this first relay extended to the second relay etc.

This means that the relay will only have an association between a stream and a key, but not an association between a specific sender and a key. All it knows it that the same short-lived stream is associated with the same sender, but not who the sender is.

8
  • "The key exchange between a client and a relay is not done directly but is wrapped in the onion layers like any other communication"....... I dont understand how this is possible, in order to build up the onion layers keys need to be exchanged to encrypt each layer. If you are saying that the key exhange is also wrapped in onion layers then how those keys created for this?
    – Chris Owen
    Dec 28, 2021 at 11:29
  • "Tor network gets first build to the first relay, then through this first relay extended to the second relay etc."... Can you explain this further, the linked SE answer states that keys are exhanged between client and each hop
    – Chris Owen
    Dec 28, 2021 at 11:30
  • 2
    @ChrisOwen: client connects to relay A and does a key exchange with A. Then client connects through A to relay B and does a key exchange with B. B sees only that the connection comes from A, not from the client. Thus while the key exchange is done logically between the client and each relay, the relay only sees the previous relay as the physical origin (IP address). Dec 28, 2021 at 12:00
  • Ok but in this case B must return there key in plaintext as the shared secret has yet to be established between client and B. At this point what is stopping A sending some other key back instead?
    – Chris Owen
    Dec 30, 2021 at 4:05
  • @ChrisOwen: Diffie Hellman key exchange is designed to work over untrusted channels. Keys are never transmitted, but both sides derive a common key based on the exchanged data. The most A could do is disrupt the communication. Dec 30, 2021 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.