# Why routers don't just use Diffie-Hellman protocol?

Routers could just use Diffie-Hellman protocol with any computer who tries to connect to that router. Then it would be impossible to eavesdrop for anyone. Only router and computer would know the secret key for that session. No?

Or someone could act as a router and send his own public key and get the traffic through his computer and that is the reason routers don't use it?

-
I assume you mean wirelessly? The DHKE protocol is vulnerable to man-in-the-middle attacks. –  rath Nov 13 '13 at 17:06
@rath Yes, you're right. Is there any solution to fix it? –  evening Nov 13 '13 at 17:09
Only way to fix MitM is to know the public key of your communication partner. Encryption to the router is pretty useless as well, since there is no reason to believe that the router is trustworthy. We need end-to-end encryption. No way around that. –  CodesInChaos Nov 13 '13 at 17:30
Instead of public key, also shared secret works. QKD would work for some (specially) wired routers. –  user4982 Nov 13 '13 at 18:56
@user4982 well if only my router could do that... –  rath Nov 13 '13 at 21:28

[you] <--- A ---> [hacker] <--- B ---> [router]

Communications A & B are encrypted, yet you're not talking to the real router.