Me -> Node A -> Node B -> Node C -> destination
The documentation on Tor always states that only the exit node C can see plain text data. How is this possible without me talking to Node C directly?
If I have some plain text data, and want to send it encrypted to Node A, I'd usually do a Diffie-Hellman key exchange, and send the data over. But with that scheme, Node A could decrypt the data.
If Node C was somehow sharing its public key with me, couldn't Node B or Node A MITM the key?
How exactly does Tor manage its PKI? What keys are used to encrypt data where?