HMAC 许可示例没有意义

HMAC Licensing Example Does Not Make Sense

我正在为我的一个项目研究许可解决方案,其中一篇文章是这样的:

"The expiration date is represented as days (not seconds) since 1/1/1970. This way it only takes two bytes to represent the date" - [http://www.drdobbs.com/licensing-using-symmetric-and-asymmetric/184401687?pgno=1][1](在标题 "HMAC Licensing System" 下大约一半的地方)

如果返回的天数是 32 位整数,这怎么可能是正确的,这家伙怎么能将该信息放入 2 个字节?

您可以简单地将 32 位整数截断为 16 位。一个无符号的16位整数最大为65535,如果表示天数,则超过179年