Here is the puzzle. Take your name, wrap it in two random fields and the course label, add a counter, and hash the whole string with SHA3-256. Keep changing the counter until the digest starts with eight zeros — eight hexadecimal digits, which is four zero bytes. Nothing else about the digest matters.
SHA3-256( salt || "CPE645/CS685" || First || Last || tag || nonce ) = 00000000…
The two random fields are generated for you when the page loads. They matter: without them every student in the room would be searching the same space and finding the same answer, and the first one to finish could hand it to everyone else.
the message at nonce 0CPE645/CS685AdaLovelace0000000000000000
its digesta6c809e33dca481503aad17a05b0c01e0bc59ca4bc1ced49ce67a62254e2e568
That digest starts with 0 zeros as printed, 0 zero bits. The nonce is the last sixteen characters, written as hexadecimal, and it is the only part the search changes. Everything else is fixed, so every candidate is the same length and the count of hashes is the whole cost.
Each try is an independent chance of 2−n for n zero bits, and the target is fixed before the search begins. So there is no birthday shortcut here: this is the preimage side of the cost comparison, where the work is 2n rather than 2n/2.
Eight is the one the assignment asks for: eight hexadecimal zeros is four zero bytes, or 32 bits. Slide left for something that finishes while you watch, right for something that does not. The slider is locked while a search is running.
what this setting costszeros required 8 hex digits = 32 bits = 4 bytes
expected hashes 2^32 = 4.29B
at this machine run a search to measure the rate
Expected hashes and expected time for a range of difficulties, at the rate measured on this machine.| Zeros | Bits | Expected hashes | At the rate measured here |
|---|
| 2 | 8 | 2^8 = 256 | start a run to measure |
|---|
| 4 | 16 | 2^16 = 65.5k | start a run to measure |
|---|
| 6 | 24 | 2^24 = 16.78M | start a run to measure |
|---|
| 8 | 32 | 2^32 = 4.29B | start a run to measure |
|---|
| 10 | 40 | 2^40 = 1099.51B | start a run to measure |
|---|
| 12 | 48 | 2^48 = 281474.98B | start a run to measure |
|---|
Eight zeros is 32 bits: about 4.3 billion hashes expected, a few minutes of a laptop and well under a minute of a fast GPU. Now scale the same table past its end. SHA3-256 is designed for 128-bit collision resistance, which is 2128, or thirty-two zeros. Multiply the time in the last row by 296 and the answer stops being a number anyone has a use for.