Search code examples
hashcryptographymd5sha-3keccak

Is a hash function (e.g. SHA) platform independent?


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.


Solution

  • 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