How does connecting to a hidden service over tor work?

439 views

I’ve heard it explained a million times but it never clicked. Perhaps it’s the cryptography part im struggling with. It’s pretty easy for me to get overwhelmed by the technical terms.

To be clear, im talking about how a client running the tor browser manages to anonymously connect to a .onion webserver.

In: 34

7 Answers

Anonymous 0 Comments

Okay lets just say brackets mean you encrypt something. Only the correct receiver has the key to unlock it.

Regular encryption would then be

“adress (message)”

You encrypt what you’re saying, but you can’t encrypt who you talk to (because the ISP needs to know to route the message correctly)

Tor simply routes through multiple relay points. So the message you send looks like

“adress1(adress2(adress3(message)))”

From the outside it looks like you send an encrypted message to adress 1. But that isn’t the final destination. Relay server 1 opens the first layer of encryption and finds an adress, so it sends the remaining encrypted message to adress 2, who has the key to open the second layer of encryption. And so on.

In the end noone in the chain knows who the final destination is. So even if one of the servers gets hacked/raided they only see a bunch of encrypted messages getting forwarded, without any idea if the adress is just another relay or the actual receiver. (And also no information who the original sender is, they can only see one step in the chain)

Anonymous 0 Comments

Think of a Russian doll that has a bunch of smaller dolls stacked inside. Now, let’s say you want to send a message to Dave. You write your message on a piece of paper, place it inside the smallest doll and lock it with a special lock that only Dave has the key for.

Then you decide that Dave will get this doll from Charlie. So, you place the locked doll inside the next doll, along with a note that says “Please deliver to Dave”. Then you lock that doll with a special lock that only Charlie has the key for.

Then you decide that Charlie will get his doll from Bob, so you place it inside the next one with another note and lock it with Bob’s key, and then you do the whole thing once more for Alice.

The message is now ready to be sent. Because each recepient can only open one layer of the doll, none of them can know how many layers are left, or how many layers have already been peeled off. Therefore, when you pass the doll to Alice, she has no way of knowing if you are the original sender, or if you are simply passing on the doll just like everyone else.

Anonymous 0 Comments

Accessing normal web sites over tor takes your traffic through three hops so it’s hard to track you. A .onion server chooses a number of intermediary tor nodes as middlemen and connects to those over three hops. In total it then takes six hops to connect from a tor client to a .onion server through one of the intermediary nodes keeping both sides anonymous.

Anonymous 0 Comments

It’s a bit difficult to ELI5 the tor hidden service protocol but I will summarize assuming we already understand how tor makes a tor connections anonymous.

Source: https://community.torproject.org/onion-services/overview/

In summary, a service needs to advertise itself to a client but does not want to give out it’s IP. To achieve this it:

1/ sets up several long lived tor connections by asking a number of tor relay nodes to act as the services Introduction Points

2/ publish these nodes to a database held within the tor network related to the services onion address (Distributed Hash Table, DHT)

3/ a client wanting the service searches the DHT using the onion address to get the service description.

4/ client then request a random tor relay node act as it’s rendezvous point.

5/ it sends a message through the rendezvous node to one of the service’s Introduction nodes.

6/ finally the service responds & the connection is made.

The connection now consists of at least 6 tor nodes, 3 or more picked by the client & 3 or more picked by the service. This way neither the service nore the client reveals their IP address or the middle rendezvous node or each other.

Anonymous 0 Comments

I feel like I should point out that TOR was developed by the military for espionage purposes. A significant number of the nodes are almost certainly still run by people with ties to military and intelligence. I would be very surprised if they were not able to unmask everything went through the network. They’re not going to bust you for buying MDMA from Antwerp or whatever, because it only works as an espionage tool if there are non spies using it, but just be safe and aware that theres no such thing as an anonymous network.

Anonymous 0 Comments

The repeated encryption thing is when you connect to a normal web server (not .onion)

When you connect to a .onion server, a random Tor node gets chosen, and you connect to that node, and the server also connects to that node. So the client and server both know the random node, but not each other. Overall you have a connection that’s twice as long as usual, and the server knows half and the client knows half.

Anonymous 0 Comments

Lets say you want to mail something from address Home to Work but you don’t want anyone at work to know where it came from. Or anyone who might see the package in passing.

So you mail your package with a final address of [Work address] but you have an agreement with a friend who will re-mail package for you, so your actual SEND TO address is his address, with a note saying send to [Work address].

He gets the package. Scraps off your return address and puts his own, with a special code remark knowing that this package is yours and not any other friends he sends packages for, then sets the send to address to your works.

Now imagine this same process done 5 times or more in a row. Each person only knows the last person who sent them the package, nothing more, because at every point the previous return address is removed, and only the sender knows who that special remark/code belongs to.

In reality the address is the IP, and the code is the port number.