Live data from Hacker News

How HTTPS Handshake Happens

sudhakar.online

11–20 of 96 posts

Re: How HTTPS Handshake Happens

#12
post #5

Genuinely curious, as HTTPS is something I do not fully understand even with this simplification: If the browser's symmetric key is encrypted with icicibank's public key, why can't a sniffer unlock it by also requesting icicibank's public key and decrypting the key sharing message?

> If the browser's symmetric key is encrypted with icicibank's public key

For Diffie-Helman key exchange, atleast...

Encrypting/"locking" uses the public key.

Unlocking a public-key-encrypted-symmetric-key happens with icicibank's private key, which the sniffer does not have.

Here's another diagram: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exc...

Re: How HTTPS Handshake Happens

#13
post #2

There are some really cool "tricks" for avoiding the round trip — round trips are why everyone should be using a global load balancer for SSL. Clients have to send 2 packets across the world and wait for a reply, which can add >100ms before any actual work happens. http2 helps because you can multiplex a bunch of requests into a single connection, less waiting on new connections to be established. TLS 1.2 with sessio…

    TLS 1.3 has a 0rtt handshake, which is pretty baller.
    It's just not widely deployed. 
And it likely won't be. 0RTT Allows for replay attacks (I capture your packets, and replay them). Without a round trip this will always exist.

Also 0RTT is only for re-connections not initial connections.

The solution is only like 0RTT be executed once and only once, but this isn't part of TLSv1.3 and is waiting to _globally_ approved. Until then nobody smart will touch it.

---

0RTT is only supported by Cloud-Flare and Google. Cloud-Flare makes you track 0RTT yourself so a fair number of sites are insecure. Google does SSL tick synchronization across data centers because their arrogant and is extremely vulnerable to timing att-

Re: How HTTPS Handshake Happens

#15
post #2

There are some really cool "tricks" for avoiding the round trip — round trips are why everyone should be using a global load balancer for SSL. Clients have to send 2 packets across the world and wait for a reply, which can add >100ms before any actual work happens. http2 helps because you can multiplex a bunch of requests into a single connection, less waiting on new connections to be established. TLS 1.2 with sessio…

>"There are some really cool "tricks" for avoiding the round trip — round trips are why everyone should be using a global load balancer for SSL. Clients have to send 2 packets across the world and wait for a reply, which can add >100ms before any actual work happens."

What is a "global load balancer"? A load balancer doesn't avoid any round trips. The "work" of TLS begins as soon as the client sends a ClientHello which is during the second round trip. On a new connection the total round trips is 4 if you include the GET request. It's 3 round trips if you only consider the TCP hand shake and the TLS handshake. This is true whether there is a load balancer or not.

Re: How HTTPS Handshake Happens

#16
post #2

There are some really cool "tricks" for avoiding the round trip — round trips are why everyone should be using a global load balancer for SSL. Clients have to send 2 packets across the world and wait for a reply, which can add >100ms before any actual work happens. http2 helps because you can multiplex a bunch of requests into a single connection, less waiting on new connections to be established. TLS 1.2 with sessio…

>"There are some really cool "tricks" for avoiding the round trip — round trips are why everyone should be using a global load balancer for SSL. Clients have to send 2 packets across the world and wait for a reply, which can add >100ms before any actual work happens." What is a "global load balancer"? A load balancer doesn't avoid any round trips. The "work" of TLS begins as soon as the client sends a ClientHello whi…

I assume a load balancing / caching solution that is available on an anycast IP address. The TLS termination happens at the (ideally) closest point of presence (PoP). The idea is to reduce the RTT from client to its termination point.

Think CloudFlare CDN or the Google Cloud Load Balancer.

Edit Mistyped RTT as TTL.

Re: How HTTPS Handshake Happens

#18
post #5

Genuinely curious, as HTTPS is something I do not fully understand even with this simplification: If the browser's symmetric key is encrypted with icicibank's public key, why can't a sniffer unlock it by also requesting icicibank's public key and decrypting the key sharing message?

The content is actually pretty terrible and not likely to help anyone understand much about TLS.

This however is a decent resource for learning the things you're asking about such as public key crypto, asymetric vs symetric, digital signatures, etc. Specifically weeks 5 and 6. The whole course is good though.

https://www.coursera.org/learn/crypto#syllabus

Re: How HTTPS Handshake Happens

#19
post #17

Can someone explain what "any of my trusted keys" in the graphic is referring to? (on the browser)

Certificate authorities. Think VeriSign, InCommon, Let's Encrypt, etc. The folks that we generally implicitly trust to authenticate popular websites. Your laptop comes distributed with many certificate authorities that are configured to be trusted by default.

Re: How HTTPS Handshake Happens

#20
post #17

Can someone explain what "any of my trusted keys" in the graphic is referring to? (on the browser)

It's impossible to bootstrap a secure connection without some preexisting trusted relationship. Otherwise, you'd always be vulnerable to middle-person attacks.

Browsers solve this problem by bundling a number of trusted root certificates. (This is what they mean by "my trusted keys".)

When you connect to some web site, the server sends you their certificate along with a chain of signing certificates up to some root of trust. Assuming the root certificate is among those your browser trusts, you can verify the signature chain and establish a trusted connection.

Post reply on HN