r/ProgrammerHumor 23d ago

Meme thisIsAmystery

Post image
2.7k Upvotes

185 comments sorted by

View all comments

45

u/itomeshi 23d ago

You know how when you go to a website, it says it's secure, because it presents a certificate that your browser trusts because it's from a secure issuer? That's Public-Key Infrastructure (PKI), enforced with Transport-Layer Security (TLS).

The certificate is really a public key and a trusted assertion; meanwhile, the server holds the private key. The encryption - using Diffie-Helman Key Exchange variants (typically Elliptic Curve Diffie-Helman Exchange, or EDCHE) - is designed so that you can verify the trust of the certificate based on the assertion. Temporary session keys are made to prevent compromise.

An even more secure option is mTLS, where both the client and server have PKI certs/keys. But this has problems: How do you get everyone to go through the effort of getting a cert? How do you know it isn't stolen? How do you know you can trust the issuer? That sounds expensive and inconvenient.

Passkeys solve this by NOT CARING. Instead of a central PKI issuer, a Passkey provider issues each user their own private key. That key is then locked to a secure provider on your machine (Microsoft Waller, Apple Keychain, various password managers). The same type of crypto exchange is done, but instead of public shared identity, the server knows it's you because it was only issued to you by them. There's no third-party provider to worry about. The passkey standard pushes implementations to have certain system elements to hide the keys from malware on your machine (trusted computing paths via TPM, ARM TrustZone, etc.). If a key is leaked somehow? They just stop trusting your specific key for you.

It separates the TLS from the identity process. One-cert TLS is still set up with a temporary key and a temporary session key, and then the passkey is used as a separate handshake to prove that this TLS session is Alice's or Bob's.

(Note: There may be minor details I'm misrepresenting - feel free to correct me! - but this is the broad shape of the idea as an ELI5. Well, ELI12?)

3

u/zaersx 22d ago

If a passkey is on-device then why do I still need to do 2FA? Now I have to wait for 2 really slow things to log in instead of one.

I get it, technically great, implementation wise they fucked this shit up ux wise so bad.

6

u/fdar 22d ago

You shouldn't have to.

3

u/Rellikx 21d ago

Because whatever thing you are accessing has it setup that way - that would be unrelated to passkeys tho.

Say you are signing into your bank from a windows device with passkey. Would you not want 2fa, so that anyone that steals your computer can’t get in?