MoyuScript / 2fa-test

22 stars 7 forks source link

如何判断 hmac 是 sha-1,sha-256 还是 sha-512 ? #1

Closed Ferry-200 closed 5 months ago

Ferry-200 commented 5 months ago

background 中提到 totp 不一定像 hotp 那样使用 sha-1。不同的 hmac 会产生不同的验证码,该如何判断哪种是正确的?

Google Authentication 和 Microsoft Authentication 都可以兼容三种 hmac 的 totp,所以我觉得是有特定的判定方法的。

MoyuScript commented 5 months ago

https://github.com/google/google-authenticator/wiki/Key-Uri-Format

Ferry-200 commented 5 months ago

👌。谢谢