

Furthermore, since the messages are encrypted with keys of other nodes, each node cannot acquire the original messages, which prevents eavesdropping. They also cannot recognize 1) whether the previous node is the sender or just an intermediary node 2) whether the next node is the receiver or just another intermediary node. In this process, each node only knows the identity (e.g., IP address) of its previous one and next one, but has no idea of other routers in the path. When a message is sent back from the destination to the sender, the reverse order of encryption is used. After decrypting by node C, the message is in plaintext, which will be sent to the actual destination. Then node A sends the onion to the next node B, and then C. For example, when the onion arrives at node A, the outer layer is “peeled” off by the private key of A. Each node in this path will “peel” off one layer of the onion by decrypting with its own private key. Once the onion is created, it will be transmitted along the path of A→B→C. The original message of the sender will be first encrypted by the shared key of node C, then further encrypted by the key of B, and finally by the key of A. For example, suppose the chosen nodes are A, B, and C in which the message will go though A→B→C and finally reach the destination. When a user wants to send a message to a destination, the Tor client first randomly selects a set of nodes ( onion routers) to transmit the message, then use their shared keys to encrypt the original message into as many layers as there are nodes. The core idea of Tor is a data structure called onion. So here I summarize my findings from some publications and blog posts. I am very interested in its underlying theory and implementation, but cannot find a post that covers enough details of what I want to know about it. Therefore, it is very difficult (although not impossible) to trace the message sender. In an onion network, messages are first encrypted, and go through a series of randomly picked proxies (called onion routers) before reaching the destination. The Onion Router, commonly referred as “Tor”, is a well-known technique for anonymous communication.
