Why can’t sha256 be reversed easily?

1.04K viewsMathematicsOther

Can’t the steps be reversed one by one to get back the original?

In: Mathematics

25 Answers

Anonymous 0 Comments

With SHA256 the original message is expanded from 512 bits to 2048 bits. These expanded bits depend on the original message. That is, changing 1 bit in the original message changes many bits in the expanded message.

The 256-bit internal state of the function is initialized to its starting value (its a constant, the same every time). The 2048-bit message is then processed in 64 rounds, each round updates the internal state. The internal state then becomes the output.

Knowing this, suppose you were given a hash and wanted to work backwards. So you start by guessing message bits and working backwards through each round, calculating the internal state in reverse. Eventually you will get to the start of the function to find your internal state does not match the initial value. So you modify your internal state to match the initial value, but you need to offset those changes by modifying the message bits, but changing those message bits changes lots of message bits all over the place, and you need to offset those changes by modifying the state. It’s a mess.

You end up with a HUGE satisfiability problem which nobody knows how to efficiently solve.

You are viewing 1 out of 25 answers, click here to view all answers.