Reading assignment: Hashing

Thank you Mauro! I love the academy man, learning so much!

1 Like

1.- SHA256

2.- Because in order to brute-force it you need an astronomical amount of computational power ( hashing power, which means the research of that data string that was introduced to find the output to integrate one single block in the chain. )

We are talking about millions of years actually. :wink:

Its not that the number is long in itself, but the amount of combinations it would take is astronomically big.

The question was more focused towards the hash function in general. I will rephrase the question. Why is it really hard to guess the input of a given hash?

I am glad to hear you are learning a lot. I love the academy as well. :heart:

1 Like

Do you know why? :smiley:

An interesting way to answer the question. I like it.:slight_smile:

Uh oh. 256^2 is only 65536. This would have been broken in seconds. You switched the numbers, probably by accident. The number of guesses would be 2^256. :smiley:

The input is not limited in size. It can be as low as 1 character or as large as you wish. However the output will always be 256 bit long, or 64 digits in the hexadecimal format.

I would argue that it is impossible rather than expensive.The computers we currently have are no way near efficient to crack it. Because our computers are so inefficient they would need an extremely large amount of energy, which we cannot capture in any way. :smiley:

Why would it be difficult?

Using random inputs does not make the brute force impossible. What makes it impossible is the amount of possible combinations that you would have to go through in order to brute force it. :smiley:

Looks good to me. :smiley:

1 Like

The question was regarding the hash function in general. Finding an input based on the output (brute forcing) is not possible due to the amount of the combination we would have to go through. In bitcoin, hashing is used to secure the blocks. A miner needs to create a hash that will be lower than the current difficulty target, otherwise it will not be a valid block. Your answer mixed both of these things, which made me confused a bit. Hopefully this will clear everything. :slight_smile:

EDIT: I see your other reply.

This is the correct answer. :smiley:

The hash that is generated is not large in size. In fact its only around 32bytes. What makes brute forcing impossible is the large amount of combination we would have to try. This would be a hard computational task. :smiley:

Hash functions need to be one way functions. Exactly, its easy to convert data into hash but not hash into data. This is due to the large amount of combinations we would have to try in order to get the original input. :smiley:

1 Like

Quite an interesting way to answer this question, in fact, you implemented it very well in bitcoin. It is indeed impossible for a miner to put the required hash and then reverse the function to find the nonce. A great example why miners must spend all that electricity to find the correct hash.

I tweeted you reply: https://twitter.com/Mauro4897/status/1276277797166690304

Brute forcing a hash means you are willing to try every possible input combination until you get that desired hash. :smiley:

Correct. But the question is asking us what is the name of the hash algorithm used in bitcoin?