How to create a system to generate hashes and be able to break without the original string?

7

Is there any way to break the Sha-256? Is there a mathematical process for getting a break?

I need to create a program that generates several hashes and another one to break without having the original string (similar to Bitcoin), only using the processing.

    
asked by anonymous 19.11.2015 / 13:24

1 answer

8

SHA-256, like any well-done hash system, is pre-image resistant (). This means that, given the value of a hash, it is impractical to find (with high probability) any data that gives rise to that hash. Thus, the only known way to "invert the hash" is to generate a large amount of data and have it one by one, until it has the same result as the original hash.

Because SHA-256 is a fairly fast hash - and easily paralleled - it is possible to break many hashes if the original data is a reasonably short string (eg, typical user passwords). For this reason it is often used in conjunction with a salt , which is a random value that is concatenated before the data ished out, and then saved together with the value of the hash. If this salt is long enough (nowadays 64 bits is used, I believe, but to make sure 128 is better) then it is totally impractical to invert the hash - because the number of attempts needed to hit is higher than combined computing power of all humanity.

(I've been talking rubbish: the difficulty to invert a hash is the same, using salt or not; salt only prevents you from breaking many hashes using a single rendering. Do not use SHA-256 to protect passwords , or any other low entropy data. Unless you can keep salt secret, of course, but then it's called a "key," and the resulting construct is a form of MAC .)

Note: You mention Bitcoin, but Bitcoin's mining system does not reverse hashes in any part of its operation. What is done is to get the hash of the block being formed (includes the hash of all the blockchain behind it, in a structure known as # ) and append a random value, hasheando and see if the result satisfies the criteria of difficulty of the network. This criterion is basically to verify that the final value is less than or equal to an arbitrary value, which is adjusted up or down depending on the combined processing power of the entire Bitcoin network (estimated according to the frequency with which new blocks are created, in compared to the target of 1 block every 10 minutes).

    
19.11.2015 / 14:06