Google Authenticator 的備份功能不是 E2EE (end-to-end encryption)

前幾天提到了 Google Authenticator 總算是支援備份功能了:「Google Authenticator 支援備份到 Google Account 的功能」,當初操作的時候沒看到自訂密碼之類的功能,就有在猜應該不是 E2EE,直接攔傳輸內容也被證實沒有 E2EE 了,TOTP 的 secret token 都是直接傳輸的:「PSA: Google Authenticator's Cloud-Synced 2FA Codes Aren't End-to-End Encrypted」。

Google 的發言人回應 CNET 的詢問時只說會有計畫做,但沒有給更細的資料:

To ensure that we're offering a full set of options for users, we have also begun rolling out optional E2EE in some of our products, and we plan to offer E2EE for Google Authenticator in the future.

在意的人就還是先不要開...

iOS 上的 Yubico Authenticator App 正式支援 NFC

Yubico 宣佈 iOS 版的 app (Yubico Authenticator) 正式支援 NFC 了:「Yubico Authenticator App for iOS Now Supports NFC」,先前在九月時的說明告知了 iOS 13 的 API 允許透過 NFC 讀與寫 (先前只能讀):「iOS 上的 Yubikey」。

作業系統的要求就如前面提到的需要 iOS 13+,而硬體上需要 iPhone 7 之後的機種,之後看看市場上的反應...

GitHub 推出軟體版的 U2F Authenticator (目前只有 macOS)

用軟體實做 U2F,目前是開發在 macOS 上:「Introducing Soft U2F, a software U2F authenticator for macOS」。

實在是不愛這種方式,由於是軟體式的,安全性低了不少... (機器被入侵後就都沒有防護了)

不過 U2F 是目前少數可以在 protocol 層抵抗 phishing 的方式,相較於一般 OTP 的方式還是得很注意網址,所以站在推廣的立場的確是希望能多一點人用...

把主力手機從 iPhone 換到 Android

上次主力用 Android 應該是 HTC Desire 時代了,那個時候跑得是 2.2。

總算把 LG G2 (D802) 刷完機器了 (刷了半年,每次都卡關 XDDD),這次刷了 CyanogenModOpen GApps,儘量都用 command line 來刷。

adb devices # 看裝置順便打 RSA public key 進去
adb shell # 進去後可以 ls/su 看一看
adb push filename.zip /sdcard/
adb reboot recovery

Android Marshmallow (6.0) 另外多了對權限的管理,這也是想刷到 6.0 的原因之一,使用者可以隨時 revoke 掉某些權限 (沒有處理好的會 crash XD):

Android Marshmallow introduces a redesigned application permission model: there are now only eight permission categories, and applications are no longer automatically granted all of their specified permissions at installation time. An opt-in system is now used, in which users are prompted to grant or deny individual permissions (such as the ability to access the camera or microphone) to an application when they are needed for the first time. Applications remember the grants, which can be revoked by the user at any time.

其他安裝的流程主要都是苦工了,尤其是 2FA 是少數為了安全性只能一個一個換的東西 (不提供 export,都是用手機提供的 HSM 避免被盜走),剛好趁機會把自己與公司用到的 2FA 帳號分開。

Android 上的 Google Authenticator 不怎麼好用 (不能調整位置,另外不希望隨時都給密碼),測了測 Red Hat 出的 FreeOTP Authenticator 算是比較好用的,就把 FreeOTP Authenticator 拿來給個人用,Google Authenticator 拿來給公司的帳號用。

繼續熟悉現在的 Android 環境,應該會有一陣子不習慣...

如果要自己寫 TOTP 的幾個要看的東西...

整理下來:

有玩過 HMAC 的人,讀這些文件應該不難...

TOTP 在預設的情況下,其實就是 HMAC-SHA-1 後取後面 32bits,然後轉成數字取 100000 的餘數,而 TOTP 文件是架構在 HOTP 的定義上,把時間切齊 (預設 30secs) 變成整數丟進去攪和,然後特地交代要處理 2038 年超過 Int32 的 case XDDD

最後 Google 那份文件是要輸出 QR code 讓手機可以讀的方式,建議不要用網路服務產生 QR code (因為有 secret key 啊),寧可自己抓 library 建一個用...

另外 Google Authenticator 一堆東西都只能用預設值 (Currently, the XXX is ignored by the Google Authenticator implementations.),所以也沒什麼好選的,就拿預設值吧... :o

Server side 的話,至少我在 CPAN 上面看到 Authen-OATH 可以用了,用起來也很簡單 :o