Can anyone solve this? Ok so I have
two hashes shown below. When decrypting the SHA2-512 hash to a 256 hash you get the 256 hash shown. But what im trying to do is somehow decrypt /encrypt the SHA2-256 hash into the SHA2-512 hash but am not having any luck with converting it. Can anyone figure out how to convert the 256 hash to the 512 hash?
The short answer: It wasn’t. It’s the other way around:
>>> import hashlib
>>> s = 'e7b59e3da584993f37ab67c9ce165501fc1204658a04a133d443923249393ce1acf0a31ef130629abb300cbbb70608045deb096dfdf59d03648b312bc6acf31a'
The long answer:
Your SHA256 value is the SHA256 hash auf the given 64 byte hex string (the assumed SHA512).
Hashing functions are one-way algorithms, and there is no way to revert them. All you can do is brute-force the original value by calculating the according hash for “all possible” inputs and comparing the result against the original hash.
So, if you know that original input was a SHA512 hash, then you would have to try all possible 512bit input values (which will take slightly longer than the sun’s remaining lifetime ).
I know the SHA2-512 hash when converted will give you the 256 hash listed. I just wasnt sure if there was an easy way to reverse it. So the answer is pretty much no not without brute forcing. No calculations can be made to get the result only brute force?