如何对 SHA-256 进行两次编码?
很简单,如何获得下面的“第二轮”?
你好
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824(第一轮sha-256)
9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50(第二轮sha-256)
我去了一个在线哈希计算器,输入“hello”,得到了第一轮,然后将该哈希值放入计算器,得到了与第二轮不同的结果。那么它是如何做到两次的呢?
Very simply, how does one get the "second round" below?
hello
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of sha-256)
9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50 (second round of sha-256)
I went to an online hash calculator, put in "hello", got the first round, and then took that hash and put it into the calculator and got a different result than the second round. How does it do it twice then?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您将第一个哈希输出粘贴回哈希计算器进行第二轮时,您将其哈希为字母和数字的 ASCII 字符串,而不是这些十六进制数字表示的实际字节序列。换句话说,插入哈希计算器的字符串的第一个字节实际上需要是 0x2C,而不是 0x32(这是“2cf2...”开头的字符“2”的 ASCII 值)
When you pasted the first hash output back into the hash calculator for a second round, you were hashing it as an ASCII string of letters and numbers, not as the actual sequence of bytes expressed by those hex numbers. In other words, the first byte of the string you plug into the hash calculator needs to actually be 0x2C, not 0x32 (which is the ASCII value of the character '2' at the beginning of "2cf2...")