[Community Puzzle] SHA-256 Hash

https://www.codingame.com/training/hard/sha-256-hash

Send your feedback or ask for help here!

Created by @schachmatt,validated by @rozbrajaczpoziomow,@Karocyt and @Cmdr.Shepard.
If you have any issues, feel free to ping them.

Educational puzzle :+1:
It’s easier to use the regular hash values first, to be able to compare partial results with the linked tutorial. Then swap for the values of the puzzle before submitting.

3 Likes

Oh, this is a tedious business, cryptography …
Thanks to the author for the work.

1 Like

Incredibly good puzzle! I’m digging it!

1 Like

I’m a bit stuck on this one can any one help. I pass the first three tests, the shorter ones. Then the longer ones I fail.

I split the message into 55 character chunks and after the chunk is encoded I add

h0 += a … though to h7 += h.

Then concat h0 - h7 for the result.

Any help would be appreciated.

Use the actual initial hash values and compare your results with https://qvault.io/cryptography/how-sha-2-works-step-by-step-sha-256/
If you go step by step you should figure out where is the problem :slight_smile:

2 Likes

Thanks. Got it. I mistakenly assumed the padding to 512 meant I had to break up the originally message before padding…hence the 55 character chunks. After re-reading the linked specs pseudo code I realized what I was doing.

1 Like

Hi All, Its really interesting and for me all the test case are passing but it shows only 80% and validator 5 is getting failed. I am not getting the problem exactly.

Thanks for puzzle.
The link for step by step died. Anyone know where I can find an equivalent ?

https://web.archive.org/web/20220118124040/https://qvault.io/cryptography/how-sha-2-works-step-by-step-sha-256/

2 Likes