如何使用一个密码创建 pin(又名 Google 2-Factor-Auth)
也许你们中的一些人知道 Google 的 2-Factor-Authentication;首先 Google 生成一个常量密码(例如“abcd”)。 如果您登录,系统会要求您输入 PIN 码,应用程序可以生成该 PIN 码,或者您也可以使用 10 个预设 PIN 码之一。有趣的是,您不必使用一个 PIN,应用程序会在不使用网络访问的情况下生成一个随机PIN。
这是怎么做到的?我知道如何使用一个特定的引脚来完成此操作,但是如何使用多个“随机”引脚呢?
谢谢, 马克
maybe some of you know Googles 2-Factor-Authentication; first Google generates a constant password (eg. "abcd").
If you login, you're asked for a pin, an app can generate that or you can use one of 10 preset pins. The interesting part is, that you don't have to use one pin, the app generates a random one without using network access.
How is that done? I know how to do it with one specific pin, but how could you use several "random" pins?
Thanks,
Marc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是通过 HOTP(基于哈希的 OTP)等系统实现的。 RFC 详细解释了它的工作原理,但简而言之:
预先生成的 OTP 列表只需如上所述提前生成。
This is made possible by systems like HOTP (hash-based OTP). The RFC explains how it works in detail, but in short:
Pre-generated lists of OTPs are simply produced as described above, ahead of time.
我相信谷歌通过计算它认为您可以使用的多个引脚来做到这一点,并且愿意接受任何匹配的引脚。
这是一个重要的可用性功能,因为这意味着如果有人使用 2-factor 登录一次失败,他们可以尝试再次登录并且仍然可以。
I believe that Google does it by computing multiple pins that it thinks you could use, and is willing to accept any of these that match.
This is an important usability feature, because it means that if someone fails to login once using 2-factor, they can try to login another time and still be OK.