diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java index 0f63d8371..05a84ef7b 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java @@ -6,9 +6,11 @@ import cn.hutool.crypto.digest.HMac; import cn.hutool.crypto.digest.HmacAlgorithm; /** - *
HMAC-based one-time passwords (HOTP) 一次性密码生成器, + *
HMAC-based one-time passwords (HOTP) 基于HMAC算法一次性密码生成器, * 规范见:RFC 4226.
* + *基于事件同步,通过某一特定的事件次序及相同的种子值作为输入,通过HASH算法运算出一致的密码。
+ * *参考:https://github.com/jchambers/java-otp
* * @author Looly diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java index 50ed4e8d0..7a3b96b3f 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java @@ -7,9 +7,12 @@ import java.time.Duration; import java.time.Instant; /** - *time-based one-time passwords (TOTP) 一次性密码生成器, + *
time-based one-time passwords (TOTP) 基于时间戳算法的一次性密码生成器, * 规范见:RFC 6238.
* + *时间同步,基于客户端的动态口令和动态口令验证服务器的时间比对,一般每30秒产生一个新口令, + * 要求客户端和服务器能够十分精确的保持正确的时钟,客户端和服务端基于时间计算的动态口令才能一致。
+ * *参考:https://github.com/jchambers/java-otp
* * @author Looly