df987cfd23fbc92e7e87faaca300ec3f

df987cfd23fbc92e7e87faaca300ec3f

本文介绍了简单的实现SHA-3 Keccak的散列在C#中的错误输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会尽量简短,简单!我正在学习C#和我试图让HashLib库@ 因此,一些明显。错了

The application builds and runs ok, but the output is very wrong. When I use other people 's implementations of the Keccak algorithm, I get different results and it doesn't match for example this wiki post either. https://en.wikipedia.org/wiki/SHA-3 So something is obviously wrong.

当我离开文本空,按例如,我得到了以下内容:df987cfd23fbc92e7e87faaca300ec3f等等,等等而维基和其他工具,说我应该得到

When I leave the text empty, as per example, I get the following: "df987cfd23fbc92e7e87faaca300ec3f etc. etc." while the wiki and other tools say I should get

0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e

"0eab42de4c3ceb9235fc91acffe746b29c29a8c366b7c60e4e67c466f36a4304c00fa9caf9d87976ba469bcbe06713b435f091ef2769fb160cdab33d3670680e"

,这是完全不同的东西。我也当然非空字符串试了一下​​。

,which is something entirely different. I also tried it with non-empty strings of course.

有没有人有一个建议?

推荐答案

您HashLib的版本太旧。如果你看一下你可以看到测试向量从改变一个你到了一个你应该得到的。 (该算法也改变了,当然。)

Your version of HashLib is too old. If you look at the recent changes you can see the test vector changed from the one you got to the one you should get. (The algorithm changed as well, of course.)

这篇关于简单的实现SHA-3 Keccak的散列在C#中的错误输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 10:07