• LedgeDrop@lemmy.zip
    link
    fedilink
    arrow-up
    15
    ·
    16 hours ago

    I’ve already been avoiding them because I don’t see how there’s any security advantage over TOTP…

    I’m not going to challenge your choice in using passkey or not. However, I do want to set the “technical record straight”: passkey is the successor to TOTP in every technical way*.

    TOTP works by having a “shared secret” saved by both you and the place that your authenticating against. This shared secret is then mixed with current time to generate a rotating number that the client shares with the remote server. The remote server does the same calculation, if the rotating numbers match, the user is successfully authenticated.

    With TOTP, this means that there are two attack vectors: your device and the remote server. If an attacker is successful in getting the “shared secret” from either, your TOTP is effectively broken.

    Passkey works more like ssh-keys. The client generates a public and private keypair. The client only shares the public portion with the remote server and stores the private key locally (or in your password manager).

    So the only attack vector (with passkey) is your device (this is often why it’s bundled with attestation). Also passkey is not dependant on both the client and server having their time kept in sync. With TOTP, if you have more than ~30 seconds drift between the client and server, they will be generating different rotating codes and never match (which is confusing when you need to explain this to your Grandma).

    • there is one thing TOTP can do, that passkey cannot: TOTP is 2FA, your TOTP can reside on a separate device (ie your phone when logging in using your PC). With passkey, you’d need to enable 2FA on the passkey manager (which varies from manager to manager).

    …unless the passkey is the only way to access the account (which would be awful for account recovery).

    Recovery options are never going to go away. With TOTP, you often have one-time use backup codes. Email, SMS recovery etc.

    • BruisedMoose@piefed.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 hours ago

      Thank you so much for clearly and concisely explaining how TOTPs are kept in sync between server and user. I KNEW the answer couldn’t be “magic”.

    • Infernal_pizza@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      4
      ·
      14 hours ago

      Oh that’s good to know, I didn’t realise TOTP was vulnerable on the server side. I’m still going to steer clear of passkeys for now though.