Bitcoin Stack Trade is a query and reply web site for Bitcoin crypto-currency fanatics. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The most effective solutions are voted up and rise to the highest
Requested
Seen
32 instances
I’m conscious that, theoretically talking, there isn’t any strategy to assure {that a} reversed hash is definitely what’s inputted to the hashing operate. Nevertheless, to illustrate that I’ve a picture, I write down the file dimension of that picture after which run it by means of the SHA-256 hashing algorithm. I then distribute the hash to all the ~6.5 billion smartphones on our planet, together with the preliminary file dimension. How lengthy would it not take for all smartphones in existence on earth to completely brute pressure a SHA-256 hash, not like Bitcoin the place you solely should reverse a few of it?
Darcy Sutton is a brand new contributor to this web site. Take care in asking for clarification, commenting, and answering.
Try our Code of Conduct.
- An Apple M1 CPU can do round 2 GB/s of SHA256 (based mostly on the optimized 2-way hardware-accelerated ARMv8 code in Bitcoin Core added in PR24115) on a single core.
- Smartphones are considerably slower than M1 laptop computer CPUs resulting from energy utilization limitations, however let’s ignore that, and conservatively overestimate each smartphone has a hexacore CPU that may do that a lot, so 12 GB/s per machine in whole.
- SHA256 operates on blocks of 64 bytes. Let’s assume that the attacker picks a set prefix, after which simply must grind the final 64 bytes + padding (one additional block) of the file. In order that they’re simply hashing 128 bytes. (12 GB/s) / 128 B ≈ 94 million tries per second, per machine.
- 6.5 billion units instances which means 6×1017 information per second in whole.
- Each file try has a chance of two-256 of yielding an accurate preimage. Meaning one wants within the order of two256 tries to have an affordable probability of discovering a preimage.
- 2256 / 6×1017 ≈ 2197 seconds
- The age of the universe is round 13.7 billion years, or 258.5 seconds.
- Thus the assault would take round 2197 / 258.5 ≈ 400000000000000000000000000000000000000000 instances the age of the universe.
