Re:Show HN: SHA-256 explained step-by-step visually
by manceraio on Monday February 07, 2022 @11:54AM
(#30247472)
Thanks for the feedback and I am glad you'll use it for teaching (which was the main goal of this project)! The padding part it's briefly explained on the "dynamic" notes on the left column, but yes, can be improved. Typing on the input gives you some sense of what is doing on the background, specially if it jumps to two blocks.
The "for each chunk" is also implemented (which was one of the most difficult parts to synchronize with the UI), but I agree too, I should come up with some way to represent it better. Thanks again :)
Re:Show HN: SHA-256 explained step-by-step visually
by fragmede on Tuesday February 08, 2022 @12:06AM
(#30255088)
Minor nit: input could also take hex.
Re:Show HN: SHA-256 explained step-by-step visually
by miki725 on Monday February 07, 2022 @06:35PM
(#30253054)
Was about to reply with the link to the project. If anyone is curious about sha2 highly highly recommend to go thorough the project. Jack did an amazing job explaining everything step by step. Writing the code really helps to understand all the concepts much better.
Re:Show HN: SHA-256 explained step-by-step visually
by Drdrdrq on Tuesday February 08, 2022 @04:10AM
(#30256315)
Thank you for the link to your repo, this it the first time I heard about length extension atracks. TIL, appreciate it! This SO answer explains them nicely, if anyone is curious: https://crypto.stackexchange.com/questions/3978/understandin...
Re:Show HN: SHA-256 explained step-by-step visually
by Dowwie on Tuesday February 08, 2022 @06:33AM
(#30257248)
What course did you teach?! Have you got a syllabus?
Re:Show HN: SHA-256 explained step-by-step visually
by oconnor663 on Tuesday February 08, 2022 @10:20AM
(#30259393)
Applied Cryptography (CS-GY 6903) at NYU Tandon. You can find all our programming problem sets in the same repo: https://github.com/oconnor663/applied_crypto_2021_fall.
A couple of details missing from this visualization are how you pad a message to be a multiple of the block size, and how you chain blocks together to form a longer message. In the pseudocode at https://en.wikipedia.org/wiki/SHA-2#Pseudocode, that's the "Pre-processing (Padding)" part and the "for each chunk" loop just below it. I get why you'd want to leave those things out, since they're not really the interesting part, and the screen is already pretty packed as it is.
If anyone's feeling curious about implementing this yourself, take a look at these project notes: https://github.com/oconnor663/applied_crypto_2021_fall/tree/.... At some point I'll clean that up for public consumption, but for now just ignore the parts about grades and cheating :)