what if the hacker provided the public key for https connection?

https://monyet.cc/post/4974494

what if the hacker provided the public key for https connection? - monyet.cc

So this video explains how https works. What I don’t get is what if a hacker in the middle pretended to be the server and provided me with the box and the public key. wouldn’t he be able to decrypt the message with his private key? I’m not a tech expert, but just curious and trying to learn.

All TLS/HTTPS clients have a set of Certificate Authority keys which they trust. Your client will only accept a public key which is signed by a trusted CA’s key. A proper CA will not sign a key for a domain when it has not verified that the entity that wants it’s key signes actually controls the domain.

A proper CA will not sign a key for a domain when it has not verified that the entity that wants it’s key signed actually controls the domain.

Most browsers trust many certificate authorities from all over the world.

Any of them could…

  • be compelled by authority
  • be compelled by threat
  • be hacked
  • have a lapse in ethics
  • have a rogue employee
  • etc.

…and yes, it has happened already.

HTTPS as most of us use it today is useful, but far from foolproof. This is why various additional measures, like certificate pinning, private CAs, and consensus validation are sometimes used.

It is indeed true that some CAs have seriously misbehaved; however, browser builders are rather strict on the presence of the CAs they trust. Misbehaving or even simple errors are reasons for getting kicked out, after which certificates signed by those CAs are now no longer valid.
I’m somewhat skeptical. What if LetsEncrypt decided to misbehave tomorrow? Would the browsers have the guts to shut it down and break all sites using it?
Yes, they will. We’ve seen it before in mostly less serious cases: Diginotar, Türktrust, Symantec, etc. As brittle as the CA system can be, when there is real enough trouble, CAs do get revoked.