Onion routing

Onion routing is a method for achieving anonymous communication across a computer network by encapsulating messages in multiple layers of encryption—each layer corresponding to a relay node, akin to the layers of an onion213. As data travels from the sender to the receiver, it is routed through a series of network nodes called onion routers. Each node removes or decrypts a single layer, revealing only the address of the next node in the path. Importantly, no single node knows both the origin and destination of the message, significantly increasing privacy21.

Key Features

  • Layered Encryption: Messages are encrypted with a separate key for each node on the route; only the intended node can decrypt its layer, making traffic analysis or eavesdropping extremely difficult23.
  • Node Path (Circuit): The sender selects a random sequence of relay nodes (the circuit). Each node only knows the node immediately before and after it2.
  • Entry and Exit Nodes: Communication enters the onion network via an entry node and exits through a final node, which then sends the decrypted message to its destination12.
  • Anonymity: Source and destination IP addresses are masked throughout transit, preventing outside observers from linking senders and receivers13.
  • Use Cases: Commonly used for privacy-sensitive activities, such as protecting against government surveillance, bypassing censorship, safeguarding whistleblowers, and ensuring confidential business communications3.

Example: How Onion Routing Works

  1. The sender chooses a random sequence of relay nodes.
  2. The sender wraps the message in successive layers of encryption, each meant for a specific node in the sequence2.
  3. The message is sent to the entry node, which removes its encryption layer to find the address of the next relay.
  4. Each subsequent node peels off a layer and forwards the message until it reaches the exit node.
  5. The exit node forwards the now fully-decrypted message to the intended recipient213.

Widely Used Implementation: Tor

The most famous implementation of onion routing is Tor (“The Onion Router”), begun in the 2000s and now operated by a global non-profit organization. Tor enables anonymous browsing, messaging, and more, and is accessible using specialized software like the Tor Browser2679.

Limitations

  • Performance: Routing through several nodes adds latency.
  • Endpoint Vulnerabilities: While transit is protected, the entry and exit nodes, and traffic beyond the network, may be vulnerable unless end-to-end encryption like HTTPS is used3.
  • Potential for Misuse: The anonymity provided can facilitate both positive (privacy, free speech) and negative (illicit activity) uses3.

Onion routing remains a cornerstone of internet anonymity and privacy in both research and real-world applications52.

  1. https://privacyhq.com/documentation/onion-routing-explained/
  2. https://en.wikipedia.org/wiki/Onion_routing
  3. https://www.geeksforgeeks.org/computer-networks/onion-routing/
  4. https://www.freehaven.net/anonbib/cache/onion-routing:ieeesp1997.pdf
  5. https://www.onion-router.net
  6. https://en.wikipedia.org/wiki/Tor_(network)
  7. https://www.torproject.org
  8. https://www.voltage.cloud/blog/what-is-onion-routing-how-does-it-work
  9. https://www.avast.com/c-tor-dark-web-browser
  10. https://slcyber.io/blog/how-tor-works/