T3ddy19 wrote:
Well, I was the Security person installing a complete PKI system at a banking site. It involved creating key pairs for both the server and the client. So the client would have a private key for his part of the connection, and the clients public key was available to view the encrypted data. Likewise, in this scenario, the server had a public and private key as well. This is a very secure method of connectivity with key “exchange”. However, an SSL site may not always provide a key exchange. You will get a security certificate to view encrypted data, but a key pair exchange does not occur without the entire key pair exchange. I think Proton email provides this type of key exchange, but not all “ssl” sites. It can be a bit complicated. This info came from an ssl dot com site:
”Discussions of PKI will quickly lead to you SSL which require a private key and a public key. The private key is held on the web server. The public key is embedded in the SSL certificate. When you visit a website and you see that lock to the left of the address bar, and the URL says https, your browser will automatically download that public key along with the certificate, which confirms that the website is indeed who it presents itself to be.” This validates the site, but not the client. A key pair exchange is required to have a 2 way encrypted exchange with PKI key pairs, vs a single SSL web site. It’s been a while since I worked on this huge project. But while SSL and PKI are related, they are not the same thing. It is much easier to use SSL vs full PKI with 2 key pairs. It’s too much for this forum, but searching on PKI bs SSL provides lots of info about the differences.
The private keys are necessarily present on both ends of the connection.
For HTTPS, the end that is usually most interesting is the one on the server, and that private key and the signed public key are then used to check the signed public key against the trust store.
There are applications where the certificates on both ends of the connection are verified.
The private key doesn’t leave the client or leave the server, but the private key is necessarily involved in the challenge-response math.
The clever parts of PKE is how it doesn’t share the private keys present on each end, but does use it in the verification to “prove” its existence and correctness, and (when done right) sets up ephemeral keys to avoid cases where a subsequent breach of a private key allows previously-captured network connection data that used that key-pair to be decrypted. That would be bad. Oh, and how it uses math that’s easy to calculate in one direction, and hard in another; some operations are very difficult to reverse. The math underlying cryptographic hashes (digests) are also similarly one-way, but that’s fodder for another reply.
TLS inherently includes the handshake (this is the TLSv1.3 stuff) for the handshake), the key exchange, and establishing the session keys (those preferably being ephemeral), the certificate verification, and negotiates the connection encryption algorithm used, among other details, and only then lights up the lock icon.
If you’re creating key-pairs for that bank, that’s either a self-signed setup with key-pairs for each connection, or generating a private key and a certificate signing request. The CSR is then signed by either a commercial certificate vendor, or by whoever is administering the local organization's own private certificate authority. The commercial signing providers is how most websites work, in conjunction with certificate vendors and the trust stores implemented by most (though not all) operating system vendors. The private stuff works just fine—I have various of these running—but does need a trusted path to load the public key into the various clients.
I’ve written a fair amount of TLS code (in mostly C and C++, though with some Swift) (the Apple PKE and TLS frameworks are easier than libtls, and libtls APIs is easier than OpenSSL APIs, and there are others of differing complexities), and designed and worked on various apps and app server configurations in enterprise environments, as well as writing a whole lot of documentation for both TLS and ssh connections, and more than a little troubleshooting. And yes, TLS and ssh are different in numerous ways, but the PKE parts work the same.
Most folks glaze over when discussing TLS, of course. Usually with good reason. 🤪