V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
pocarisweat
V2EX  ›  YubiKey

请教一个有关 YubiKey 和 WebAuthn 的问题

  •  
  •   pocarisweat · 2022-11-28 14:44:14 +08:00 · 1470 次点击
    这是一个创建于 486 天前的主题,其中的信息可能已经有所发展或是发生改变。

    苹果今年 WWDC 公布那个 Passkey ,我理解就是 Safari 支持 WebAuthn+把密钥整合到 Keychain 里。

    如果密钥是存储在用户的手机电脑上然后用 Face ID 保护,这个好理解,用户可以 Keychain 里创建很多对密钥,每个网站的每个账号一对。

    但是像 YubiKey 这种设备,它没有那么大的存储空间,如果用同一对密钥处理不同网站的话,那么同一个网站有多个不同账号的情况怎么解决呢?或者说,它其实是有有限的存储位置的,比如一个 YubiKey 可以保存 30 个网站的密钥对,更多就得买个新的?

    6 条回复    2023-01-05 09:13:58 +08:00
    me221
        1
    me221  
       2022-11-28 14:47:54 +08:00
    是的 满了之后只能买新的
    me221
        2
    me221  
       2022-11-28 14:53:37 +08:00
    我最近再关注这个产品: https://twitter.com/yishi_oh/status/1593225895946641408

    有 28G 存储空间.
    imnpc
        3
    imnpc  
       2022-11-28 14:59:10 +08:00
    WebAuthn 不一样 一个硬件 key 可以对应无数个网站
    他会按照规则 为每个验证站点生成公钥 一般是按照域名
    对方网站存储公钥 验证的时候公钥加密
    yubikey 按照规则解密签名数据 然后验证是否通过
    Tyanboot
        4
    Tyanboot  
       2022-11-29 23:55:15 +08:00   ❤️ 2
    fido2 版本的话,是两种情况,持久化和非持久化的储存。

    简单的来说,持久化储存就是你想的这样,设备里面存了凭证,这个凭证是包含了你用户名和域名之类的的,所以是有限制储存的,对于 yubikey 5 来说,能够存最多 25 个这种凭证。对于这种情况来说,就是登录的时候连用户名都不用输入了,都是从设备里面读取的。

    另外一种情况就是不持久化储存,fido 1 的时候就是这样的,fido 2 也是同样支持不持久化储存。这个的原理是,设备自己有一个主密钥,当需要生成新的密钥的时候,设备先生成一个密钥,然后把这个密钥用自己的主密钥加密,再把加密后的密钥作为凭证 id 传出去。后续需要用到这个私钥的时候,因为凭证 id 也是要传给 fido 设备的,这样就能让设备对这个 id 解密,拿到真正的私钥,这样设备就不需要实际储存密钥了,缺点就是不能保存用户名和域名了。

    这些应该是在 yubikey 开发者文档里面有提到了,具体在哪里就不记得了。
    yuezk
        5
    yuezk  
       2022-12-09 17:46:18 +08:00
    最近在研究 WebAuthn ,确实如 @Tyanboot 所说。做了测试,当 Yubikey 的 25 个本地持久化的 key 满了之后还可以用非本地持久化的 key ,缺点就是登录之前要提供用户名。
    z0wjqnxi
        6
    z0wjqnxi  
       2023-01-05 09:13:58 +08:00
    yubikey 5 系列的容量:
    OTP - this application can hold two credentials. However, Yubico OTP, one of the most popular kinds of credentials to put in this app, can be registered with an unlimited number of services.
    FIDO U2F - similar to Yubico OTP, the U2F application can be registered with an unlimited number of services.
    FIDO2 - the YubiKey 5 can hold up to 25 discoverable credentials in its FIDO2 application.
    OATH (Yubico Authenticator) - the YubiKey 5's OATH application can hold up to 32 OATH-TOTP credentials (AKA authenticator app codes).
    *PIV - the YubiKey 5's PIV (smart card) application has 24 slots, each of which can hold one certificate and its corresponding private key (click here for further information).
    *†OpenPGP - the YubiKey 5's OpenPGP application can hold up to three OpenPGP private keys, one for encryption, one for signing, and one for authentication.
    https://support.yubico.com/hc/en-us/articles/360013790319-How-many-accounts-can-I-register-my-YubiKey-with-
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1195 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:24 · PVG 02:24 · LAX 11:24 · JFK 14:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.