2 ms·
> We do not have time to explain public key cryptography right now, but this is basically the encryption key we’re going to use to talk secretly. If there's on
by tialaramex 7y ago
> We do not have time to explain public key cryptography right now, but this is basically the encryption key we’re going to use to talk secretly.
If there's one misunderstanding that it'd be valuable to clean up about protocols like TLS in 2020 this would be it.
It is technically possible to do this. It's how PGP worked for example, and it was how SSL was originally conceived, but it is not now commonly used and is unsupported entirely in TLS 1.3
Let's take my connection to send this message to Hacker News. It's not TLS 1.3, but the previous version TLS 1.2 instead, and it has a 2048-bit RSA public key in the certificate. Is this key used "to talk secretly" ? No!
Instead my browser and HN's server use a variant of the Ephemeral Diffie-Hellman protocol with Elliptic Curves to pick a completely random key and that key is used "to talk secretly". The public RSA key's role is only to prove that I am communicating with Hacker News and not somebody else pretending to be them. That's all it is for on modern sites talking to modern browsers.
This is what Forward Secrecy is all about. Since the keys used to secure messages were not based on that fixed long term RSA key, but instead a random key both parties soon forgot about, we achieve Forward Secrecy as neither of us can (whether by mistake or on purpose) later reveal how to decrypt the messages.
- yjftsjthsd-h 7y agoThat depends on your cipher selection, IIRC. At a previous job, we had an appliance that got a mirror port of our uplink and could record HTTP sessions between customers and our webapps; it was given a copy of the private key, and it worked great, right up until newer HTTPS standards pushed PFS and broke it.
- tialaramex 7y agoIt is still technically possible to do RSA key exchange. About 2% of sites surveyed for SSL Labs "Pulse" don't offer anything better. Current browsers will (reluctantly) accept that you only speak RSA. But it's a terrible idea. If your employer purchased that appliance believing it was anything other than a temporary stopgap they were incompetent and/or the appliance was mis-sold. The right way to build such an appliance records the session keys. The growing pile of keys is a constant reminder (in a way that a copy of one RSA private key is not) that this is valuable/ dangerous private information which you should have a habit of routinely destroying once it's not operationally vital.
- yjftsjthsd-h 7y agoYeah the appliance was old and painful to work with at the best of times. We actually managed to remove it when it broke and we couldn't figure out to fix it:) Ended up replacing it with gathering stats on the actual application servers, which was so much better (better even than recording keys, because the app sees traffic without any encryption in the way). EDIT: I guess my original point was that, while it's not a good idea, at least as of early 2019 it was possible to do the old-style encryption.
- fulafel 7y agoIt's also possibly to use an out of band transmitted pre-shared key with TLS, see eg this Python module that exposes OpenSSL's support for the TLS PSK feature to Python: https://github.com/drbild/sslpsk https://github.com/drbild/sslpsk.
- crispyambulance 7y agoTo be fair, the focus of the article was an introduction to TLS certs, what's in them, and how they're used. There's a lot of complexity, confusion and jargon in this topic and Julia made a good call not go into the rabbit hole of public key encryption. Perhaps it would have been better to just say the RSA key "is used as part of the process" of encrypting traffic between browser and server.