1

Can I use neural network to identify a hash function like sha256? I mean, generate a bunch of hash codes by different hash functions and also labels. Then, feed these codes into a neural network. Will it work?

Huayan Sun
  • 11
  • 1
  • https://security.stackexchange.com/questions/135211/can-a-neural-network-crack-hashing-algorithms and https://stats.stackexchange.com/questions/366272/can-machine-learning-decode-the-sha256-hashes – julian Jan 09 '19 at 05:59

1 Answers1

4

No. The output of a cryptographic hash function (like SHA256) is indistinguishable from random data. The only feature that'd be useful to a neural network would be the length of the hash -- and you don't need a neural network to tell you that a 256-bit value could be SHA256.

  • Is there any requirement that a secure hash function is indistinguishable from random? That seems intuitive to me for a good hash function as it leads to a more even distribution for preventing collisions, but does it lead from any of the usual requirements of hash functions (pre-image, second pre-image, and collision resistance)? – Steve Jan 09 '19 at 03:49
  • @Steve Effectively, yes. Standard measures of collision resistance assume that all hash outputs are equally probable. For a hash function to be distinguishable from random data, some hashes would have to be more probable than others, or even entirely impossible. –  Jan 09 '19 at 04:03