1

I need to compare hashed data from different platforms. The hash function used is Keccak's SHA3.

I started with the assumption that the hash generated values were platform independent; but then these two online tools proved me the opposite:

Here is the respective output when I hashed the word data (sha3 256bits):

  • 8f54f1c2d0eb5771cd5bf67a6689fcd6eed9444d91a39e5ef32a9b4ae5ca14ff
  • efda893aa850b0c0e61f33325615b9d93bcf6b42d60d8f5d37ebc720fd4e3daf

My knowledge on the subject is quite limited, but I have always taken for granted that hash functions were platform independent (that's why we use MD5 checksum, right ?).

Any light on the subject will be highly appreciated.

Best.

sdia
  • 65
  • 7
  • 2
    Yes, hash functions should be platform independent. There is probably some encoding problem, different parameters or some implementation bug. – Artjom B. Jul 03 '15 at 11:01
  • The final SHA-3 specification hasn't been published yet, so I recommend sticking with SHA-2 for now. – CodesInChaos Jul 06 '15 at 21:56

2 Answers2

2

Yes a hash algorithm should return the same value everywhere, aside from encoding issues.

You will get the same hash if you choose the algorithm Keccak-256 instead, i'm not sure what they use for SHA3-256:

http://emn178.github.io/online-tools/keccak_256.html

martinstoeckli
  • 23,430
  • 6
  • 56
  • 87
  • Keccak and SHA3 have differences in padding scheme, so results should be different. – Qiu Jul 03 '15 at 14:42
0

SHA-3, specifically (and distinctly from Keccak) is specified in FIPS 202 as of August 2015.

All implementations should product the same results with the same inputs.

Official test Vectors are available at the NIST CAVP Testing: Secure Hashing page.

Anti-weakpasswords
  • 2,604
  • 20
  • 25