Google身份验证器是一款TOTP与HOTP的两步验证软件令牌,此软件用于Google的认证服务

Google身份验证器是一款TOTP与HOTP的两步验证软件令牌,此软件用于Google的认证服务。此项服务所使用的算法已列于 RFC 6238 和 RFC 4226 中。

Google身份验证器
開發者Google
首次发布2010年9月20日
当前版本
  • 5.10 (2020年4月23日;Android)
  • 3.4.0 (2022年3月1日;iOS)
源代码库github.com/google/google-authenticator
编程语言
  • Java (Android, Blackberry)
  • Objective-C (iOS)
操作系统Android, iOS, BlackBerry OS
系統平台移动设备
许可协议私有许可协议(早期版本为Apache License 2.0)
网站play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 

Google身份验证器给予用户一个六位到八位的一次性密码用于进行登录Google或其他站点时的附加验证。其同样可以给第三方应用生成口令,例如密碼管理員或网络硬盘。先前版本的Google身份验证器开放源代码,但之后的版本以专有软件的形式公开。

典型使用情况

舊標誌

通常,用户安装身份验证程序在智能手机上。为了登录到使用两步验证的网站或服务上,用户提供用户名和密码后运行身份验证器进行额外验证。 该应用程序会生成六位数的一次性密码,而不同网站可能会生成同一密码。

为了使身份验证器正常工作,安装运行之前网站必须向用户提供一组共享密钥。这组密钥将会用于未来的所有登陆请求。

在两步验证的保护之下,仅仅拥有用户名密码已不足以入账户。攻击者需要这组共享密钥或者拿到进行两步验证的移动设备。另一种方法是进行中间人攻击;若用户的电脑被木马侵入,则用户名、密码及一次性密码都将被木马所捕获,随后攻击者即可利用木马进行登录、监听或修改用户与网站的通信。

实现

谷歌提供安卓、黑莓和iOS版本的身份验证器。同时也存在有第三方版本。

  • Windows Phone 7.5/8/8.1/10: Microsoft Authenticator Virtual TokenFactor
  • Windows Mobile: Google Authenticator for Windows Mobile
  • Java CLI: Authenticator.jar
  • Java GUI: JAuth FXAuth
  • J2ME: gauthj2me lwuitgauthj2me Mobile-OTP (仅支持中文) totp-me
  • Palm OS: gauthj2me
  • Python: onetimepass, pyotp
  • PHP: GoogleAuthenticator.php
  • Ruby: rotp, twofu
  • Rails: active_model_otp (第三方实现)
  • webOS: GAuth
  • Windows: gauth4win MOS Authenticator WinAuth
  • .NET: TwoStepsAuthenticator
  • HTML5: html5-google-authenticator
  • MeeGo/Harmattan (Nokia N9): GAuth
  • Sailfish OS: SGAuth, SailOTP
  • Apache: Google Authenticator Apache Module
  • PAM: Google Pluggable Authentication Module oauth-pam
  • Backend: LinOTP (后端管理使用Python实现)
  • Chrome/Chrome OS: Authenticator
  • iOS: OTP Auth
  • privacyIDEA 认证系统。

技术说明

服务提供商为每个用户生成80位的密钥(然而RFC 4226 §4要求使用128位并建议使用160位密钥)。 它以16位、26位或者32位base32的字符串亦或是二维码的方式提供出来。客户端使用此密钥生成HMAC-SHA1。经过HMAC处理过的信息可能为:

  • 自UNIX时间(TOTP)起始之后所经过的30秒周期数
  • 随着每个新密码所增加的计数(HOTP)

一段哈希值被提取出来并转换为6位数密码。

生成一次性密码的伪代码

  function GoogleAuthenticatorCode(string secret)key := base32decode(secret)message := floor(current Unix time / 30)hash := HMAC-SHA1(key, message)offset := last nibble of hashtruncatedHash := hash[offset..offset+3]  //4 bytes starting at the offsetSet the first bit of truncatedHash to zero  //remove the most significant bitcode := truncatedHash mod 1000000pad code with 0 until length of code is 6return code

生成事件性或计数性的一次性密码伪代码

  function GoogleAuthenticatorCode(string secret)key := base32decode(secret)message := counter encoded on 8 byteshash := HMAC-SHA1(key, message)offset := last nibble of hashtruncatedHash := hash[offset..offset+3]  //4 bytes starting at the offsetSet the first bit of truncatedHash to zero  //remove the most significant bitcode := truncatedHash mod 1000000pad code with 0 until length of code is 6return code

Android上的开源情况

Google身份验证器在Google Play商店上目前(2017年9月16日)以私有版权协议发布。Google在GitHub上开放了其身份验证器源代码,并陈述如下:

“此开源计划包含了2.21版本的源代码。随后的版本中包含了Google特有的工作流程,与此项目无关。”

Android版本的独立分支之一为FreeOTP,其基于Google在GitHub上所开源的最新版本。另外一个并非很火的分支OTP Authenticator也在Google Play上可供下载。

参考文献

  1. ^  . TechCrunch. 2010-09-20 [2016-03-12]. (原始内容存档于2020-12-02).
  2. ^  https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2; 检索日期: 2021年9月10日.
  3. ^  ‎Google Authenticator on the App Store; 检索日期: 2022年5月9日.
  4. ^  . GitHub. Google. [2017-10-15]. (原始内容存档于2021-01-26) (英语). These implementations support the HMAC-Based One-time Password (HOTP) algorithm specified in RFC 4226 and the Time-based One-time Password (TOTP) algorithm specified in RFC 6238.
  5. ^  Willis, Nathan (22 January 2014)."FreeOTP multi-factor authentication (页面存档备份,存于)". LWN.net. Retrieved 10 August 2015.
  6. ^  https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2 (页面存档备份,存于) A
  7. ^  . App Store. [2017-10-15]. (原始内容存档于2015-12-22).
  8. ^  . 4 April 2013 [2017-10-15]. (原始内容存档于2019-10-17).
  9. ^  . 26 February 2012 [2017-10-15]. (原始内容存档于2013-09-08).
  10. ^  . XDA Developers. [2017-10-15]. (原始内容存档于2019-04-19).
  11. ^  . [2017-10-15]. (原始内容存档于2014-08-01).
  12. ^  . GitHub. [2017-10-15]. (原始内容存档于2015-08-04).
  13. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-09-05).
  14. ^  . [2017-10-15]. (原始内容存档于2016-01-06).
  15. ^  . [2017-10-15]. (原始内容存档于2016-03-16).
  16. ^  . [2017-10-15]. (原始内容存档于2017-10-15).
  17. ^  . [2017-10-15]. (原始内容存档于2018-01-05).
  18. ^  . [2017-10-15]. (原始内容存档于2016-01-06).
  19. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-10-27).
  20. ^  . GitHub. [2017-10-15]. (原始内容存档于2018-06-11).
  21. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-09-29).
  22. ^  . [2017-10-15]. (原始内容存档于2019-07-11).
  23. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-09-12).
  24. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-12-05).
  25. ^  . [2017-10-15]. (原始内容存档于2020-10-20).
  26. ^  . [2017-10-15]. (原始内容存档于2016-01-11).
  27. ^  . [2017-10-15]. (原始内容存档于2020-02-17).
  28. ^  . [2017-10-15]. (原始内容存档于2015-05-17).
  29. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-12-05).
  30. ^  . GitHub. [2017-10-15]. (原始内容存档于2014-07-05).
  31. ^  Techtransit. . [2017-10-15]. (原始内容存档于2014-07-12).
  32. ^  . [2017-10-15]. (原始内容存档于2019-07-11).
  33. ^  . [2017-10-15]. (原始内容存档于2021-01-10).
  34. ^  . [2017-10-15]. (原始内容存档于2015-11-19).
  35. ^  . [2017-10-15]. (原始内容存档于2015-02-10).
  36. ^  . [2017-10-15]. (原始内容存档于2016-08-08).
  37. ^  . [2017-10-15]. (原始内容存档于2019-10-17).
  38. ^  . App Store. [2017-10-15]. (原始内容存档于2019-04-12).
  39. ^  https://tools.ietf.org/html/c#section-4%5B%5D
  40. ^  . [2017-10-15]. (原始内容存档于2020-11-12).
  41. ^  . GitHub. [2017-10-15]. (原始内容存档于2020-11-22).

外部链接

  • Google帮助上的Google身份验证器 (页面存档备份,存于)
  • GitHub上的Google 身份验证器 (页面存档备份,存于)旧版本源代码
  •  在Stack Overflow上使用Python实现的Google身份验证器 (页面存档备份,存于)
  • F-Droid資源庫上的Android軟體套件Authenticator

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部