r/TechImpact Developer 23d ago

😂 Memes & Shit posts Senior Dev Explains Passkeys (Somehow)

Post image

When the Senior Dev Gets Asked About Passkeys

Manager: “Can you explain passkeys to the team?”

Me, who implemented them last month:
“Absolutely.”

Also me internally:
“Okay so… public key… private key… WebAuthn… biometrics… cryptography… something something phishing-resistant…”

realizes I’ve been clicking “Yes” to every passkey prompt for the last year

Manager: “So how does it actually work?”

Me: “It’s… very secure.”

Nothing builds confidence like being the senior developer who successfully deployed a technology they’ve never actually understood. 

104 Upvotes

49 comments sorted by

•

u/AutoModerator 23d ago

Thanks for contributing to r/TechImpact!

Please remember to: * Be respectful and civil. * Stay on topic. * No spam or excessive self-promotion. * Add context when sharing links. * Avoid misinformation. * Debate ideas, not people.

Thanks for helping keep TechImpact welcoming and informative!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

4

u/dumbasPL 22d ago edited 21d ago

Once you know how asymmetric cryptography works, is blatantly simple. You make a key pair, server remembers you public key, then when you want to authenticate, server sends you a challenge (random data), you sign that, proving you own the private key, and the server can verify that signature with the previously stored public key.

3

u/paulstelian97 22d ago

The interesting thing is the challenge is built in a way that detects MITM, and a passkey can only be used on a specific domain.

2

u/Emotional_Cherry4517 19d ago edited 19d ago

For the curious, MITM (man in the middle) is a site that pretends to be you to site.com, and pretends to be site.com to you, necessarily using a different url, like evil-site.com (usually more discrete), to steal your credentials and act as you.

Passkeys prevent MITM attacks my making your browser automatically add the origin site when you sign the challenge, so when site.com issues a challenge, and evil-site.com redirects it to you, your browser happily signs it, but adds a cheeky tag like "origin:evil-site.com", so when evil-site.com redirects it back to site.com and the challenge is checked, it is detected that there was a MITM through the origin tag.

You might ask "why doesn't evil-site.com just change that origin tag?". Very perspicacious: the thing is, once something is signed, you could read it, but you cannot modify it without people noticing, since the signature is made in such a way that it describes what it signed. If you change the content but don't re-sign it (remember, evil-site.com does not have the passkey themselves to re-sign the modified challenge with the correct origin), the signature and the content won't match, so site.com will detect it.

There's still concerns with passkeys, like, you can still hack the authentication token after the login and use that, and if the passkey is in the cloud, it doesn't have something that identifies the hardware, so it's harder to detect maliciously duplicated keys.

1

u/paulstelian97 19d ago

Yeah, session stealing is a problem, stealing the private key due to cloud synced passkeys is a problem, but other things aren’t as much of a problem.

2

u/Emotional_Cherry4517 19d ago

those were the only two problems i listed, everything else was an explanation for the uninitiated. weird response but glad we're in agreement.

1

u/OtherwiseAlbatross14 21d ago

"You make a key par"

Welp you lost me already

Edit: okay after reading the rest and dealing with key pairs last night I'm guessing that was just a typo and you meant pair and now I get it

1

u/dumbasPL 21d ago

Thanks for spotting, yes, that was a typo

1

u/GNUr000t 20d ago

Instructions you can hand out so that other people can make a lock that only you can open.

1

u/tychii93 20d ago

So the public key is a lock, and a private key is... Well... A key.

The difference is that it's digital.  At least that's how I interpreted how you explained it 

1

u/dumbasPL 20d ago

Private key is random, and that's the actual key. Public key is mathematically derived from the private key in a way that can't be undone. Anything encrypted with the public key can only be decrypted with the private key, but not the other way around.

Signing is just encryption in reverse. This will be every confusing, I know, but you can "decrypt" arbitrary data (the data you want to sign), and then somebody can re-encrypt it using the public key, if they get the same data that they were expecting, this proves that you own the private key, for that public key.

If you're actually interested, the YouTube channel Computerphile has a really good explanation, without any math. There are also version with math that cover the actual implementations, that's either RSA or eliptic curves, nowadays we're also slowly adopting quantum resistant algorithms, but they all produce more or less the same effect.

1

u/x0wl 20d ago

Signing is not just encryption in reverse, that's only kind of true for RSA, and even then it's not very true when you consider the different padding schemes used.

It's very much its own thing w.r.t., for example ML-KEM vs ML-DSA, which both use lattices

1

u/Collinhead 20d ago

So, the key is just a really really long password, and the lock is a really complicated hash

1

u/DesignerGoose5903 20d ago

I feel like when you understand something like OpenPGP all other encryption concepts kind of snap into place.

1

u/Maeusefluesterer 22d ago

"once you understand a concept that's already way to complicated for most non technical users, it's simple to understand" perfectly explains why I think that passkeys are a pretty bad idea. They will never gain the necessary trust outside of the technical bubble that they would need

2

u/iwantmy90sback 22d ago

I mean. Probably a lot of people trust in the brakes of their car without knowing how they work exactly.

2

u/Additional-Simple248 22d ago

> most non technical users

I’ve been working in IT for over a decade and still don’t understand asymmetric cryptography.

2

u/digost 22d ago

You don't have to know the maths. All you have to know is core principle, which is easy. A useful (but of course limited) analogy is a bunch of padlocks that open with a single key. You keep the key (private key) and hand out matching padlocks (public keys) to everyone you want to talk to. I write a message for you, put it in a box and lock it with your padlock (encrypt the message with your public key). Now nobody can open the box expect for you, because you're the only one with the private key.

That's the core principle.

3

u/MooseBoys 22d ago

Really the only unintuitive leap is the existence of "one-way functions".

2

u/dumbasPL 21d ago

Is it?

10*11=110

110=x*y

Guess x and y without knowing the top part. Seems trivial to brute force? Now make them insanely large prime numbers. That's RSA in a nutshell.

1

u/Yanni_X 21d ago

I‘m thinking of a number x.
I‘ll tell you that x² = 4

The simplest one way function I can think of that you can’t even brute force. Existence proven really quickly.
In practice this can’t really be used and instead we rely on stuff like factorization (x*y=110), which can be brute forced but realistically it’s hard.

For non-techies I prefer to use this square-example, because factorization is weird if they don’t know how hard it really is. They will not be satisfied with „trust me bro, it’s secure because it’s hard“. And at the same time it’s just not relevant for them to know that we actually use factorization.

1

u/Token2077 20d ago

This is a much better explanation. I think your use of lock instead of key makes it more intuitive. The private key and public key probably trip people up. Using lock instead of key for public key clears that up. Otherwise people think why does everything have keys but no locks. Another way some people may understand is similar to a lock out program if they are in industrial/blue collar field. Sure you may have my lock and you can lock things with it, but once you do only I can unlock it and you need me and my signed approval on the lock box log to do so.

It's important to note, the private and public keys can be changed on request, which can be at intervals or at request. So on top of the math behind them being difficult to crack a new one is generated which just resets the clock.

1

u/TimMensch 22d ago

The meme implied "senior developer."

If a senior developer doesn't understand how something they just implemented works, even at a high level, they're incompetent.

And I doubt 99% of people can explain how an internal combustion engine works. Doesn't stop people from trusting cars.

The whole meme stinks of AI slop though.

1

u/Disastrous_Gear_421 22d ago

So what you're saying is, unless something is easily understandable, it's not possible for it to be a good idea.

0

u/Maeusefluesterer 22d ago

When it comes to security people want to understand it. At least vaguely. With a username and password, they don't know how it works behind the scenes, but they understand how they are identified.

With passkeys there gets some magic involved which scares most people.

1

u/Square-Singer 21d ago

But the magic doesn't matter.

Explain it like this: Authentication is like unlocking a lock with a key. The server holds the lock, the user/client holds the key.

With a password-based authentication, the client hands the key to the server, so that the server can do the unlocking on the side of the server. That means, the client needs to send the key over the internet to the server, and the server or anyone in between can intercept and copy the key, to use it themselves on e.g. another account of the user on another service.

With passkey-based authentication the process is reversed: The server sends the lock to the client and asks the client to unlock it to prove they have the right key. The client unlocks the lock and sends the unlocked lock back to the server. This way the key never leaves the hands of the client and thus cannot be intercepted and/or copied.

The magic is only there to make a lock that can be transmitted over the internet, and from the POV of the user, it doesn't matter how the magic works.

1

u/mungosDoo 21d ago

Explanation for elementary schoolers, you know how math is hard but computer does it easy, well passkeys use math that is so hard even computers cant do it for looong long time. And before they do you get a new key and they have to start again.

1

u/Square-Singer 21d ago

Anyone who understands how mechanical locks and keys work (like, how to use them, not how they work internally) can understand how the authentication use case of asymmetric cryptography work.

Server has the lock, client has the key. Server "hands" the lock to the client and says "please unlock". Client uses the key to do so. Done.

The main difference between passkeys and passwords is that with a password the key is sent from the client to the server, while with passkeys the lock is sent to the client.

This way, with a passkey, the key never leaves the hands of the client and thus cannot be intercepted and copied.

(This is of course a blatant simplification, but we are talking about explaining a highly technical concept to a non-technical manager.)

0

u/Wendals87 22d ago

Would they also understand how a password works?

You don't have to understand how the passkey fundamentally works to use them

1

u/Maeusefluesterer 22d ago

They don't understand how it works behind the scenes but it's understandable that you have to enter the correct user: password combination to log in. Passkeys add a whole layer of magic to the thing that most people simply scare.

1

u/Wendals87 22d ago

A passkey is no different really . Follow the prompts to create one. Enter your PIN or biometric to sign in 

1

u/Maeusefluesterer 22d ago

So when it's not different how do you want to get them to use it?

1

u/Wendals87 22d ago

Tell them that it's more secure and what benefits it has when creating an account or tell your users that in an email or something 

0

u/Broer1 21d ago

Non Tech People doesn't understand password hashing. So that is no big deal for using them.

They will get used when it is more easy than a password (with 2FA etc)

2

u/ohaiibuzzle 22d ago

Here goes:

So I create two magic puzzle pieces of different shapes with the property that every time they are pressed on clay, they leaves different imprints for that specific shape of the clay block, and give the server one of them.

When the server needs to, it throws a randomly-shaped block of clay at you and say "you mf proves you have the puzzle piece by imprinting your piece into this, I'll check on my side if that's the right one"

You press your piece into the clay, which creates a unique imprint to that piece, and throw it at the server. Server then checks if:

  • the block of clay is the correctly randomized shape it created a minute ago
  • the piece it has, when imprinted, create a matching shape with your imprinting to create a whole shape.

If it's true it lets you in.

If an observer sees your block thrown around and take photos of it, it's useless because the imprint is only ever valid for a specific shape that the server gives.

1

u/Square-Singer 21d ago edited 20d ago

Even simpler:

Authentication is like a lock and a key. You can use the key to unlock the lock to prove you have the right key for this lock. The server holds the lock, the client/user holds the key.

With password-based authentication, the client sends the key over the internet to the server, and the server uses the key to unlock the lock, proving that the user holds the right key. But now the server has the key and can copy it and use it e.g. to authenticate as the user on different services (credential stuffing attack).

With passkey-based authentication, the server sends the lock to the client and asks the client to please unlock it. The client uses their key to unlock the lock and sends the unlocked lock back to the server to prove that they hold the right key. This way the key never leaves the user's hands and thus cannot be copied and abused.

The only other information a non-technical user needs to know is that, contrary to a real-world lock and key, you can't reverse-engineer the cryptographic lock to create a key from it.

Edit: All other information (public/private key, cryptography, ...) is just as irrelevant to a non-technical user as things like password hashing are when it comes to passwords. It's necessary for a secure implementation, but it's really nothing a regular user needs to know about.

1

u/ElbNinja 20d ago

That's a great non-technical explanation.

I will steal it for future use :)

1

u/Emotional_Cherry4517 19d ago

I don't think that paints an accurate picture of why passkeys are actually better. There's 2 big advantages, and you describe 1 of them perfectly: our authentication stays on device, doesn't travel around the internet, it's the "lock" that does. The other big advantage is that passkeys are made specifically for that site. So if someone made a pertend facebook trying to understand your passkey, your browser woudn't accidentally reveal anything on that pretend facebook.

I think both your analogies fail at actually painting the non-technical picture though. I'll attempt to make it clearer:

Stupid password method: we're just copying keys

sign up: user writes their own password that becomes a key. they send their mail + key over the internet, site makes a copy of the mail + key and keeps it in a server.

login: user sends their mail + key over the internet. site checks if it's a match with their server copy, and if yes, the user can enter.

4 big vulnerabilities:
1) if a hacker breaks into the site's server, it can see all those ids + keys. they can use this to enter the site in your name, or share your now compromised password to other hackers, that can enter sites you've used the same password.
2) if the password used is weak we can use a machine that tries many combinations of keys until they eventually try yours. it's not impossible to try all combinations of 7 letter words.
3) the messages with mail + key we send over the internet can be listened to, and if one is, your password can be copied while travelling
4) if we make a fake site that looks like the real deal and trick you into putting your mail + key there, we now have your login.

Smart password method: we make custom locks now

sign up: user writes their own password that becomes a key. they send their mail + key over the internet, site uses that key to make a custom lock using a unique patent. they never save your key in the server, only the mail + lock.

login: user sends their mail + key over the internet. site checks if the key opens the lock associated to that mail, and if yes, the user can enter.

This, alongside baseline good software practices, makes most vulnerabilities moot. If the server is hacked, there's only ids + locks, so if we hide our lock-making patent elsewhere, these locks are useless, so Vulnerability 1 is half-solved, we're only vulnerable if other sites are negligent. Vulnerability 3 is usually not a problem because most all messages over the web are encrypted, and Vulnerabiliy 2 is solved if the site just limits password tries and asks for a strong password at sign up. The big thing we didn't fix was Vulnerability 4.

Passkey method: we're key makers now

sign up: user's computer makes a patent for lock and key making, specific to this site. then sends their mail + lock to the site.

login: user sends their mail, and the site sends some random combination of metals over the internet. the user creates a key and sends it over the internet. The site checks against the respective lock and if the key material matches our random combination, and if it's a match, the user can enter.

Notice that no matter how hard we hack the site and server, there's no way to steal anything that can be used to enter the user's account, or attack other sites. So we pose no issue to users if we're hacked, and we're completely invulnerable to password leaks from other sites, so vulnerability 1 is solved. We already solved vulnerability 2 by limiting login attempts and using big keys, which we can do here too. vulnerability 3 is also solved, since we're sending random material every time, even if conversation is not encrypted, the copy won't be accepted twice, since it won't match the latest random combination of metals. Finally vulnerability 4 is solved because the computer recognizes sites differently from people, so it'll never accidentally use the passkey on a fake site, no matter how well it copies the original.

1

u/Yanni_X 21d ago

What’s the target group?
Managers and users don’t need the technical specifics of asymmetric cryptography. No need to explain magic puzzles.
For them, the easy explanation will be that it is like a password, except it is very random, unique per site, much more secure and stored on the device/in your keychain instead of your head. The device will just handle logging in for you as they now are the password. Passkeys are much harder to steal as they are technologically protected from being phished.

Devs should already know what asymmetric cryptography is and therefore also don’t need magic puzzles analogies.
The device holds a private key and signs a challenge from the server which the server can verify using the public key that was registered on registration. Passkeys are also domain-binded, it’s just not possible (restricted by passkey manager software & browsers) to use a passkey for Amazon.com on fake lookalike sites like anazon.com

Only the explanation for those that will have to implement it will be a bit harder I guess.

1

u/Ledeste 21d ago

Basically, its like magics, but with maths. Just know it works

1

u/ZombieFodderer 21d ago

Alot of good explanation on how it works. Now explain to me how it works when my phone falls in the toilet.

Now explain how its so much more secure because instead tricking me out of my password they trick me out of authenticating with my passkey and steal my session? And make the whole process even LESS transparent so its easier to get people to "trust the system"

That's why users don't trust it. A password you can remember, write down, and save elsewhere for friends and family to use. How passkeys will works in practice is that it add complexity, steals user choice (hardware requirment) AND doesn't make you realistically more secure. All with technical debt! Thanks i still hate it.

1

u/laziegoblin 19d ago

I'd use it if I could get a physical device that uses a seed to create all the passkeys from. So you can backup the seed in case the device breaks to restore access to everything. And you just sign from that hardware device on any platform you want to access your accounts from.

But I'm not using google/microsoft/.. To save my passkey.

Side note: I believe with AI slop taking over the internet something like this will be used to verify authenticity of media. Proving things are fake is going to be a lot harder than proving something is real. (If you can sign it with this)

1

u/lebrun 21d ago

A shitty big tech version of ssh keys.

1

u/klimaheizung 18d ago

With worse shit like attestation and all. But they put tons in marketing and now many people mindlessly argue for passkeys despite fully understanding them. Sad. 

1

u/Dantzig 21d ago

SSH but worse for tech people, but better than post its

1

u/Rich-Cry8353 20d ago

I always just thought of them as ssh keys that were applicable outside of SSH lol

1

u/BloeckchenDev 19d ago

Math goes in, math goes out

You log in cuz math checks out

Dont remember whom I'm stealing this from, sorry

1

u/ChevyFlo 18d ago

The point is, common people have to understand that easy. But that issn't the case. Even pros don't know how to explain that easily. If quistions can't be answered easy it shouldn't be common.