我正在執行OTP Google Acc。兼容。OTP Google Acc。兼容
到目前爲止,我一直在使用
-RFC2104(http://www.ietf.org/rfc/rfc2104.txt),
-RFC4226(http://www.ietf.org/rfc/rfc4226.txt),
-RFC6238(https://tools.ietf.org/html/rfc6238),並按照這個模式:
[僞代碼時間OTP](http://en.wikipedia.org/wiki/Google_Authenticator#Pseudocode_for_Time_OTP)
直到「hash:= HMAC-SHA1(key,message)」一切正常。我通過其他HMAC-SHA1轉換器檢查了多次結果。 (嗯,我認爲是)。
但是,然後,我認爲必須出問題...因爲顯然我沒有得到與我的谷歌驗證器應用程序(android)相同的代碼。 (至少它仍然是一個6位數值)。
我不安靜一定要很好地理解的部分是:
offset := value of 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
可能有人給我這個更詳細的解釋?
感謝,