-
Google Authenticator
鎖定
Google Authenticator網站簡介
Google身份驗證器給予用户一個六位到八位的一次性密碼用於進行登錄Google或其他站點時的附加驗證。其同樣可以給第三方應用生成口令,例如密碼管家程序或網絡硬盤。先前版本的Google身份驗證器開放源代碼,但之後的版本以專有軟件的形式公開。
[1]
Google Authenticator發展歷程
2023年4月,Google Authenticator身份驗證器應用獲得了人們多年來一直要求的一項功能:雲同步備份。在面向Android 和iOS推出的最新4.0版本中,谷歌添加了此功能,使其更加安全和方便。
[4]
Google Authenticator使用情況
為了使身份驗證器正常工作,安裝運行之前網站必須向用户提供一組共享密鑰。這組密鑰將會用於未來的所有登陸請求。
在兩步驗證的保護之下,僅僅擁有用户名密碼已不足以黑入賬户。攻擊者需要這組共享密鑰或者拿到進行兩步驗證的移動設備。另一種方法是進行中間人攻擊;若用户的電腦被木馬侵入,則用户名、密碼及一次性密碼都將被木馬所捕獲,隨後攻擊者即可利用木馬進行登錄、監聽或修改用户與網站的通信。
[2]
Google Authenticator開源情況
“此開源計劃包含了2.21版本的源代碼。隨後的版本中包含了Google特有的工作流程,與此項目無關。”
Android版本的獨立分支之一為FreeOTP,其基於Google在GitHub上所開源的最新版本。另外一個並非很火的分支OTP Authenticator也在Google Play上可供下載。
[3]
Google Authenticator技術説明
服務提供商為每個用户生成80位的密鑰(然而RFC 4226 §4要求使用128位並建議使用160位密鑰)。它以16位、26位或者32位base32的字符串亦或是二維碼的方式提供出來。客户端使用此密鑰生成HMAC-SHA1。經過HMAC處理過的信息可能為:
- 自UNIX時間(TOTP)起始之後所經過的30秒週期數
- 隨着每個新密碼所增加的計數(HOTP)
生成一次性密碼的偽代碼
function GoogleAuthenticatorCode(string secret) key := base32decode(secret) message := floor(current Unix time / 30) hash := HMAC-SHA1(key, message) offset := last nibble of hash truncatedHash := hash[offset..offset+3] //4 bytes starting at the offset Set the first bit of truncatedHash to zero //remove the most significant bit code := truncatedHash mod 1000000 pad code with 0 until length of code is 6 return code
生成事件性或計數性的一次性密碼偽代碼
function GoogleAuthenticatorCode(string secret) key := base32decode(secret) message := counter encoded on 8 bytes hash := HMAC-SHA1(key, message) offset := last nibble of hash truncatedHash := hash[offset..offset+3] //4 bytes starting at the offset Set the first bit of truncatedHash to zero //remove the most significant bit code := truncatedHash mod 1000000 pad code with 0 until length of code is 6 return code
- 參考資料
-
- 1. Techtransit. Nokia Store: Download GAuth and many other games, wallpaper, ringtones and mobile apps on your Nokia phone.
- 2. Google Is Making Your Account Vastly More Secure With Two-Step Authentication - TechCrunch. TechCrunch. 2010-09-20
- 3. Willis, Nathan (22 January 2014)."FreeOTP multi-factor authentication". LWN.net. Retrieved 10 August 2015.
- 4. 谷歌 Authenticator 身份驗證器安卓 / iOS 版 4.0 發佈:支持雲同步備份 .IT之家.2023-04-25[引用日期2023-04-25]