# Can i generate a SHA512 hash if i know the SHA256 hash of some unknown data?

if the SHA256 Hash of some unknown data is known ! Can i find the SHA512 of that unknown data ?

• only if you can find the exact preimage of the original hash – Richie Frame Mar 1 '19 at 21:26
• @RichieFrame Which isn't going to be possible due to the pigeonhole principle. – forest Mar 2 '19 at 2:17

No, you can’t.

There are (at most) $$2^{256}$$ different possible SHA-256 hashes.

If it were possible to deduce a SHA-512 hash from a SHA-256 hash with no knowledge of the data, then there would be at most as many different SHA-512 hashes as different SHA-256 hashes.

Then, a SHA-512 hash would be at most as strong as a 256-bit hash.

• Suppose the input message is limited to being 128 bits long. Then, with extremely high probability, its SHA-256 hash is uniquely determined, for all possible inputs. The question remains: Given the unique SHA-256 hash of such an input, can we find the SHA-512 hash? The answer is still no, but not for the reason given here. – Squeamish Ossifrage Apr 26 '19 at 23:53

The baseline of SHA256 is different than that of SHA512. This means that a hash using SHA256 is not going to be any similar to the hash of SHA512. Remember that the point of hash functions is properly make use of the avalanche effect which means that a slight change of input maps to a radically different output. The same can be said when comparing different hashing algorithms.

• This one should be the right answer. – Baby desta Apr 26 '19 at 21:40