0

Can we use an AI to be trained to predict hash functions like SHA256 and create new blockchains for mining without consuming too much energy?

1 Answers1

1

Can we use an AI to be trained to predict hash functions like SHA256 and create new blockchains for mining without consuming too much energy?

No. At least not any current AI based around machine learning by statistical approximation.

Cryptographic hash functions are very robust against statistical analysis. That is a core design criteria, to appear like a random oracle. Whilst neural networks fit to data via the statistics of that data. Neural networks can fit to non-linear relationships, but are not capable of fitting to data which cannot be separated from random numbers by any analysis (short of reverse-engineering).

In addition, hash functions are often designed to be fast to calculate, taking far less processing power to do so than relatively simple neural networks. There are exceptions for certain use cases - mainly for password hashing - but these slower designs are often created after the fact by making a simpler fast hash function repeat over many iterations that may have to include a certain amount of memory etc. Proof of work blockchain is in this category too, basically requiring the discovery of input that produces an output hash with special characteristics through random search of hashable data - the individual hashes are run very fast indeed, 100 million per second on a consumer GPU.

Potentially in future a more advanced AI system could be designed to search for attack vectors against standard cryptographic hashes. It would need to be advanced enough that it could automate the work of highly trained cryptographers, so we are talking about science fiction of superhuman general AI. Even then, it may be possible that SHA256 is not really crackable to any decent depth (we don't have proof either way), so it may be beyond any kind of intelligence.

Some cryptographic hashes will likely be attackable via quantum computing, and this may invalidate some blockchains. This kind of attack is discussed on bitcoin stack exchange for example, but does not need to involve machine learning or neural networks.

Neil Slater
  • 28,678
  • 3
  • 38
  • 60
  • Hello, thank you for your answer, But hash functions are not really random functions but rather pseudo -random functions. There's a big difference between a pseudo -random function and a random function that doesn't exist, isn't there? – z.10.46 May 28 '23 at 19:23
  • @z.10.46 Yes, except PRNGs and RNGs are similar in important key ways by design, as per this answer. It is theoretically impossible to tell the difference by analysis of the values directly, unless there is a serious flaw in the algorithm. A lot of work goes into cryptographic hashing to avoid such flaws. – Neil Slater May 28 '23 at 19:45
  • have we already trained an AI for this and to find possible flaws? – z.10.46 May 28 '23 at 20:11
  • @z.10.46 I have not, although I suspect a few people have actually tried more seriously with AI. Plenty of people have done so with other statistical tools. If I find a link for anyone trying and answering this experimentally, I will add it. Otherwise, this answer covers theoretical reasons why it won't work. – Neil Slater May 28 '23 at 20:36
  • @z.10.46 Here's a cross-validated Q&A where someone does do a short experiment for something very similar - https://stats.stackexchange.com/questions/366272/can-machine-learning-decode-the-sha256-hashes – Neil Slater May 28 '23 at 20:40
  • Thank you very match. – z.10.46 May 28 '23 at 21:06