【发布时间】:2011-06-27 21:51:16
【问题描述】:
我正在尝试实施 Salted Challenge Response Authentication Mechanism (RFC 5802),但遇到了一些问题。
Hi(str, salt, i):
U1 := HMAC(str, salt + INT(1))
U2 := HMAC(str, U1)
...
Ui-1 := HMAC(str, Ui-2)
Ui := HMAC(str, Ui-1)
Hi := U1 XOR U2 XOR ... XOR Ui
where "i" is the iteration count, "+" is the string concatenation
operator, and INT(g) is a 4-octet encoding of the integer g, most
significant octet first.
我不确定如何添加 INT(1)。我有一个用于盐的字节数组。我需要做的只是位移 1 并将其添加到数组的末尾吗?
【问题讨论】:
-
谢谢。我应该考虑建立一个链接。
-
在我看来它只是二进制序列
00,00,00,01。这是整数 1 的 4 字节编码,最重要的字节在前。
标签: c# arrays integer byte rfc