我试图围绕生成一个6位/字符非大小写敏感的一次性密码到期.
我的来源是http://tools.ietf.org/html/rfc4226#section-5
首先是参数的定义
C 8-byte counter value, the moving factor. This counter
MUST be synchronized between the HOTP generator (client)
and the HOTP validator (server).
K shared secret between client and server; each HOTP
generator has a different and unique secret K.
T throttling parameter: the server will refuse connections
from a user after T unsuccessful authentication attempts.
Run Code Online (Sandbox Code Playgroud)
然后我们有算法来生成HOTP
As the output of the HMAC-SHA-1 calculation is 160 bits, we must
truncate this value to something that can be …Run Code Online (Sandbox Code Playgroud)