我在试着理解沙家的衬垫。
填充消息abc是61626380000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000018
a=61,b=62和c=63 --我知道了。18的意思是24 in hex,也就是abc => 3.8
8和整个零是什么意思?
谢谢你的回答
发布于 2014-08-28 16:39:54
在这里扩展一些extend的评论。沙垫将消息扩展到下一个区块边界。在消息的末尾,添加一个1位(不是字节),然后是零位,直到从块结束到64位为止。使用块的最后64位以二进制形式保存消息的长度。
你的垫块由以下几个部分组成:
616263 : "abc" - the message text.
8 : "1000" - the 1 bit to start the padding, followed by padding zeros.
0...0 : The rest of the padding zero bits.
0000000000000018 : 64 bit message length, 24 bits in this case.如果消息在块边界的65位内结束,则填充需要包含整个额外的块。
https://stackoverflow.com/questions/25547473
复制相似问题