Answers.Body: <blockquote>
  <p>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?</p>
  </blockquote>
  <p>No. At least not any current AI based around machine learning by statistical approximation.</p>
  <p>Cryptographic hash functions are very robust against statistical analysis. That is a core design criteria, <a href="https://en.wikipedia.org/wiki/Random_oracle" rel="nofollow noreferrer">to appear like a random oracle</a>. 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).</p>
  <p>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.</p>
  <p>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.</p>
  <p>Some cryptographic hashes will likely be attackable via quantum computing, and this may invalidate some blockchains. This kind of attack <a href="https://bitcoin.stackexchange.com/questions/115782/post-quantum-preimage-resistance-of-hash160-addresses">is discussed on bitcoin stack exchange for example</a>, but does not need to involve machine learning or neural networks.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T19:23:11.730Z
Answers.Text: 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?
Answers.UserDisplayName: z.10.46
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T19:45:57.793Z
Answers.Text: @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.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T20:11:06.567Z
Answers.Text: have we already trained an AI for this and to find possible flaws?
Answers.UserDisplayName: z.10.46
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T20:36:32.850Z
Answers.Text: @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.
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T20:40:36.393Z
Answers.Text: @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
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-28T19:17:07.290Z
Answers.LastActivityDate: 2023-05-28T19:31:00.860Z
Answers.LastEditDate: 2023-05-28T19:31:00.860Z
Answers.UserDisplayName: Neil Slater
Body: <p>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?</p>
  
Tags: <neural-networks><machine-learning><deep-learning><blockchain>
Title: Can we use an AI to be trained to predict hash functions like SHA256 and create new blockchains without consuming too much energy?
UserDisplayName: z.10.46
ThreadText: # Can we use an AI to be trained to predict hash functions like SHA256 and create new blockchains without consuming too much energy?
  
  (Asked by: username_0 on 2023-05-28)
  
  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?
  
  **Tags:** neural-networks, machine-learning, deep-learning, blockchain
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-05-28. Score: 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](https://en.wikipedia.org/wiki/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](https://bitcoin.stackexchange.com/questions/115782/post-quantum-preimage-resistance-of-hash160-addresses), but does not need to involve machine learning or neural networks.
  
  > **Comments:**
  > **username_0**: 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?  
  > **username_1**: @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.  
  > **username_0**: have we already trained an AI for this and to find possible flaws?  
  > **username_1**: @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.  
  > **username_1**: @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  
  
  ---
  
  