2

I want to test this StackExchange Q/A.

which got 889DA12A88D36BCE0966AB1A79125779DD1F2FC6F1145DE131FD52A5B468796D from

% keccak -256 198584347013dd91832be3d82529437db7cc8e1850e559cdd3872b29ca819601

However, when I use the Keccak-256 online tool found here: https://emn178.github.io/online-tools/keccak_256.html

I get: 11d0c17e049fd25f195a6b3694d37658240961d55f263cca40f2c5f91e6fac2d

The results are not the same. Is there anything wrong?

0

1 Answer 1

2

The online tool works perfectly, but the form accepts text and you were pasting in hex. The ASCII string "198584347013dd91832be3d82529437db7cc8e1850e559cdd3872b29ca819601" is 31393835383433343730313364643931383332626533643832353239343337646237636338653138353065353539636464333837326232396361383139363031 in hex, and the online tool correctly produced a keccak256 hash of the hex of what you pasted in.

The result of your keccak -256 command is also correct.

3
  • Sorry I don't get it.. If I past "31393835383433343730313364643931383332626533643832353239343337646237636338653138353065353539636464333837326232396361383139363031" to the online tool, I still can't get the right answer.
    – Mooooo
    Feb 13, 2020 at 9:13
  • It shows a0aad49db54af4cfb5de9fb29a37131ccf1051a1068c190a4a5fd07c369c8681. But the answer is 889DA12A88D36BCE0966AB1A79125779DD1F2FC6F1145DE131FD52A5B468796D
    – Mooooo
    Feb 13, 2020 at 9:14
  • @Mooooo The online tool cannot accept hex, it can only accept ascii. But your keccak command line tool can accept hex, so you'll see that if you do keccak -256 31393835383433343730313364643931383332626533643832353239343337646237636338653138353065353539636464333837326232396361383139363031 the answer will be 11d0c17e049fd25f195a6b3694d37658240961d55f263cca40f2c5f91e6fac2d , exactly the same as the online tool reported.
    – knaccc
    Feb 13, 2020 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.